Re: [gtk-list] Re: how can I trust glib when it has so manymemleaks?




   Havoc Pennington wrote:
   > 
   > No, Unix-ish systems won't let you do that. All the memory is freed by the
   > operating system when the program is terminated. However the memory is
   > never explicitly freed by the program itself, and this is what ccmalloc
   > checks.

   Please detail one thing here: memory is alocated by my program using
   glib. You say UNIX will free  all the memory. Why isn't it freeing the
   memory allocated by glib also ? What is the use of ccmalloc if memory is
   freed by system when my program finishes ? Just to ensure that my
   program doesn't grow too much while running ?

Most programs just use malloc() and free() to handle their memory
allocations.  If you do that, and you're careful to free up everything
before you exit, ccmalloc will be able to help you.  If you are either
sloppy about not releasing memory, or if you deliberately hang onto it
because you're using your own memory allocation pool, ccmalloc won't
be able to help.
-- 
Joseph J. Pfeiffer, Jr., Ph.D.       Phone -- (505) 646-1605
Department of Computer Science       FAX   -- (505) 646-1002
New Mexico State University          http://www.cs.nmsu.edu/~pfeiffer



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