Re: [gtk-list] glib memory profiling




Stephen Soltesz <soltesz@utk.edu> writes:
> 
> 1) I have recently joined the gtk-list.  Is it correct that the archive
> of this list is not at all recent?  Anything beyond late 1998 seems
> unavailable.
> 

A better one might be at www.gnome.org/mailing-lists

> 2) Also, I understand that glib has a memory profiling option avilable
> at compilation time.  Does anyone know what impact this option has on
> apps not using the profiling features?  Meaning is there a loss of
> performance for all/any of the memory management functions? (and
> certainly as a result, the many data types).
> 

It certainly does impact performance for all apps using the library
with profiling enabled. The solution is this:
 - compile your profile-enabled glib (see glib/gmem.c to see exactly 
   what it does)
 - copy glib/.libs/libglib.a into the directory where your app 
   lives
 - remove -lglib from your app's link line and replace it with libglib.a

i.e. statically link glib, don't replace the system-wide shared
version.

> 3) Is there a better way to profile memory? ;-)
> 

Yes, Owen's "memprof" is way more useful than the glib thing anyway
and doesn't require recompilation. However it only works on Linux.

See freshmeat.net to find it.

There are also proprietary tools like Purify and Great Circle of
course. These are a bit more elaborate than memprof, but memprof 
gives you quite a bit (especially for the price :-)

Havoc



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