Memory leaks / Help with memprof & ps output



Why do I get the feeling this is a FAQ ...  well, I did some archive
searches and didn't get any satisfactory answers, so here goes ...

I am writing a program (using gtk 2.0) that needs to deal with loading a
large number of images into memory (using gdk_pixbuf calls).  Everything
works fine, except after calling g_object_unref on the pixbufs, it seems
that the memory isn't getting released to the operating system.  

It also seems that the program isn't actually leaking memory.  For
example, if, after unrefing 100M of images, I load another 50M, the
program doesn't grow at all.  Memprof shows also a pretty huge blue bar
after unrefing the 100M of images, so this leads me to believe the
memory actually is getting freed.  (Does blue mean freed memory?)
However, when using ps (or top, or whatever), the RSS stays over 100M. 
So is this memory actually getting released and I am misreading ps
output?  Is this some GtkAllocator magic and the memory is being kept
around for reuse?  If so, how do I force it to be freed?

Finally, memprof is showing 2 memory leaks, one seems to be in glibc
(add_to_global -- glibc 2.2.4), and the other in one of the X libs
(select_format - X 4.0.3).  I can post traces if anyone is curious.  I
read on the archives others seeing memprof showing leaks in X libs, but
not in glibc.

Thanks,
Jason.

-- 
Academic Computing Support Specialist
Algoma University College
Sault Ste. Marie, Ontario
705-949-2301 x330                                   Personal Home Page
http://www.auc.ca                                     http://sault.org




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