Re: Avoiding heap fragmentation in C++ program on solaris
- From: Rahul <rahulsharma@xxxxxxxxxx>
- Date: Wed, 18 Mar 2009 13:52:07 -0700 (PDT)
On Mar 19, 1:43 am, "Richard B. Gilbert" <rgilber...@xxxxxxxxxxx>
wrote:
Rahul wrote:
Hi,
My application was showing high heap fragmentation on windows which I
solved using Low Fragmented Heap (LFH) option for the CRunTime heap.
I was wondering If there exists a similar feature on Solaris (Sun CC)
compiler also. Is there any way to reduce heap fragmentation in C++
programs.
Thanks
It might help to look at your program! malloc() and free() made a lot
of sense when running in early hardware with limited memory and/or
address space. In today's virtual memory systems with Gigabytes of real
RAM it's much less necessary.
There are still situations where malloc() and free() are the right tools
for the job; I'm just suggesting that you look and see if what the
program is doing makes sense!
Hi,
There are multiple threads in the program (> 14) each does a small
amount of processing so they keep allocating and freeing small buffers
of memory (1 KB to 100 MB in size). After runing the app for 1-2 hour
the virtual memory gets fragmented (As observed on windows, But I am
not sure how to verify this on Solaris) and malloc starts failing
(for large sizes e.g. 80 MB).
The allocation size is purely random and can not be predicted in
advance. We thought of providing out own memory management using
bucket strategy (or buddy system) but that might cause high internal
fragmentation.
.
- Follow-Ups:
- Re: Avoiding heap fragmentation in C++ program on solaris
- From: Ian Collins
- Re: Avoiding heap fragmentation in C++ program on solaris
- References:
- Avoiding heap fragmentation in C++ program on solaris
- From: Rahul
- Re: Avoiding heap fragmentation in C++ program on solaris
- From: Richard B. Gilbert
- Avoiding heap fragmentation in C++ program on solaris
- Prev by Date: Re: Avoiding heap fragmentation in C++ program on solaris
- Next by Date: acrobat 9 soon arrives!
- Previous by thread: Re: Avoiding heap fragmentation in C++ program on solaris
- Next by thread: Re: Avoiding heap fragmentation in C++ program on solaris
- Index(es):
Relevant Pages
|