Re: Memory leaks in gnome_apps



On Sun, 14 Jun 1998, Jason Nordwick wrote:

> Will a GNU/Linux person please correct me if I get this wrong,
> since I don't use Linux.  This just comes from my recent
> browsing of the GNU malloc.
> 
> You libc is not GNU libc, so it uses sbrk(), even for page
> sized allocations (GNU libc uses mmap() for any allocation
> larger than a page), so it cannot be returned to the system.
> 
> It is not really a problem since modern VM systems are optimized
> for sparse memory allocation.  Is it causing a problem?
> 

You seem to be correct, that it doesn't seem to matter, I have plenty of
memory.  I was just concerned that there were no full pages being freed.
It could potentially be a problem after an application that does a lot of
widget allocation and freeing has been running for a long time.  If the
pages cannot be returned to the system, then the OS must keep them in
swap, since it doesn't know anything about what will happen when the
memory is referenced.  This could fill up swap, unnecessarily.  

Now, on the other hand, it is also disturbing that the application creates 
3000 or so widgets to display the directory, then ALL of those widgets and
associated data are freed, but only about 1/2 of it gets reused, the rest
seems to get reallocated and never reused, why?  Does GTK+ never return to
the same state after a widget is created and then destroyed?

Manish Vachharajani
<mvachhar@vger.rutgers.edu>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]