Memory-fu




I've got several questions about memory.  It would be wonderful if any   
were answered.

1.) What symbol exists in the glib libarary if the library has the memory
debugging stuff compiled in and I can actually call g_mem_profile() and
get results?  (Test whether I need to bother compiling that code in or
not) 
        
2.) g_mem_profile() reports A WHOLE LOT (ca 450k) of unfreed memory at
exit, but I can't find any problems in my code - in addition, if you close
the app immediately after start and do g_mem_profile() and when you do
some things with the app before closing, you get two different figures
from g_mem_profile() even though whatever other things you did didn't
involve memory allocation.

3.) People swear to me that g_mem_profile() will still show memory
unfreed, but it will still be available to the OS.  Ok, fine, but how do I
separate the memory my code is using from the memory that GTK+ is using,
and why does glib report it as unfreed?
        
4.) What gdb texts will give me an idea of how to find memory leaks using
gdb?  I inspect all of my vars after a program run, and they all seem to
be NULL (0x0)  Any suggestions on further docs other than info/man/manual
on how to find memory leaks?

5.) Are there any pointers that programmers having problems with
(apparent) memory leaks that they would like to pass on?  :-)

I would very much appreciate any help or pointers.  I am totally willing
to RTFM, as long as somebody will tell me which FM to R.  :)

David Allen
http://opop.nols.com/index.shtml - Linux software development
There are three kinds of people:  Those who can count, and those who can't.



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