Re: Question about memory problem

Luca Padovani <[email protected]> Tue, 09 Nov 2004 20:07:18 +0100
Newsgroups gmane.comp.gnome.gdome
Message-ID <1100027238.1610.110.camel@giraffe>
Hi,

On Tue, 2004-11-09 at 18:26 +0100, scetre wrote:
> I have :
> --------------------------------------------
[...]
> ==2434== 48 bytes in 2 blocks are still reachable in loss record 1 of
> 5
> ==2434==    at 0x4015F3AF: malloc (in /usr/lib/valgrind/valgrind.so)
> ==2434==    by 0x403DC5B1: xmlNewMutex (in /usr/lib/libxml2.so.2.6.9)
[...]
> ==2434==    at 0x4015F3AF: malloc (in /usr/lib/valgrind/valgrind.so)
> ==2434==    by 0x403D9465: xmlStrndup (in /usr/lib/libxml2.so.2.6.9)
> ==2434==    at 0x4015F3AF: malloc (in /usr/lib/valgrind/valgrind.so)
> ==2434==    by 0x4044B2C2: xmlNewCharEncodingHandler (in 
> /usr/lib/libxml2.so.2.6.9)
[...]
> ==2434==    at 0x4015F3AF: malloc (in /usr/lib/valgrind/valgrind.so)
> ==2434==    by 0x4044B389: xmlInitCharEncodingHandlers (in 
> /usr/lib/libxml2.so.2.6.9)
[...]
> ==2434==    at 0x404D6C5E: (within /usr/lib/valgrind/libpthread.so)
> ==2434==    by 0x404D85FE: (within /usr/lib/valgrind/libpthread.so)
> ==2434==    by 0x404D8717: __pthread_key_create (in 
> /usr/lib/valgrind/libpthread.so)
> ==2434==    by 0x403DCA36: (within /usr/lib/libxml2.so.2.6.9)

These leaks are "normal" and come from some one-shot allocations done in
libxml. You can get rid of them by calling 

	xmlCleanupParser()

at the end of your program. However, after doing this I still get

==6468== 16 bytes in 1 blocks are still reachable in loss record 1 of 2
==6468==    at 0x1B905901: calloc (vg_replace_malloc.c:176)
==6468==    by 0x1BC6F511: (within /lib/libdl-2.3.2.so)
==6468==    by 0x1BC6F1E9: dlvsym (in /lib/libdl-2.3.2.so)
==6468==    by 0x1BADA8B5: __errno_location (vg_libpthread.c:2139)

which appears not to be libgdome2's responsibility...

In general, it would certainly be worrying if you'd experience some leak
which is proportional to the size of the loaded document (or to the
number of times you load a document).

Hope that helps.

Cheers,
--luca

_______________________________________________
gdome mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gdome
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iD8DBQBBkRVmTJ/x5YuoHVwRAsQOAJ0Q0Dm5h0GXvZemgFYiIIetkKijggCfdQw6
5IgXEOaMUotM/PPqTqoIeGQ=
=0Zsc
-----END PGP SIGNATURE-----