Re: using memprof/Re: Memory Leakage



josh <uzs33d uni-bonn de> writes: 

Wow! Thanks for the great summary!  

Am I right in assuming that the yellow bar indicates bytes allocated and
turns blue to indicate bytes being freed? 

I'm not sure exactly; yellow seems to be current memory allocation,
red is leaks, the current version of memprof doesn't seem to have blue
but I remember it existing. ;-)

 If, when my application
exits, there's still yellow being displayed, is that necessarily a bad
thing?  I know glib allocates memory in blocks, so if there's still a
chuck left which never got used and hence not freed, would it be
reported as a leak?

No, memprof doesn't keep track of "memory that was never freed," just
"memory that you allocate and then lose track of." So, in general,
it isn't going to have any meaning at app exit.

A mem leak is not "memory left on application exit" - the operating
system will reclaim all memory when your app exits. A leak is memory
you allocate and don't free when you're done with it. But there's no
need to clean up on application exit, since that happens
automatically.

When I launch my app under memprof, it's only showing (under the yellow
bar) about 300Kb being allocated (Total Bytes: 324752), but gtop says
it's using 3640Kb on the Memory usage tab! Is this because gtop is
including, for example, shared libraries which other gnome/gtk apps are
using too?


Yes, that's one reason top isn't such a good way to find leaks. ;-)
In regular command line top, look at the "SHARE" column to see memory
used by a process but shared by other processes as well.

Havoc




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