Re: Memory leaks in gnome_apps

Manish Vachharajani wrote:
> 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.

Not really, just becaus I sbrk() 100M, it doesn't fill up swap.  And with
memory overcommits, you are allowed to allocate more memory than you have,
just don't use it, or you'll get something killed off.

> 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?

It is reused, just that you have fragmented memory, so you have holes in you
free list that aren't big enough for the next allocation that you want.  It
is a common problem.  Maybe somebody should look at the small allocation
(memory chuncks?), because the small allocated should do a better job. 
yet, they should mmap the memory they require, insteadm of mallocing it, so
can be retured to the system.    Gtk since I can remember has alot of
memory problems for such a large project, maybe its time to go make the

> Manish Vachharajani
> <>

4.4 > 95

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