[JDEV] Memory Leak Problems
Tim Sowden
tims at netpliance.net
Thu Nov 2 06:44:55 CST 2000
Hi,
I'm using the Jabber 'C' library code of jabberx and libxode from
jabber.org.
While running my application I notice that I am leaking memory. I
replaced malloc/free with my own malloc/free to trace the source of the
unfree'd memory. After running my app I am now able to pinpoint the
memory leak as being in the jabberx and libxode libraries altho I don't
know exactly which functions in there leak the memory.
The big leak that I have found is related to when I get a roster update
push from the server when I add/delete someone from my roster. This leak
is around 4K for everyone added/deleted from my roster so it's quite a
noticible amount of RAM. Note than I have around 30 people in my roster.
I suspect that I am not doing a proper free of something in my code that
the library allocates during parsing of the incoming XML message. So
what I am wondering is what am I responsible for freeing as an app from
those libraries.
Currently I call xmlnode_free() after every incoming event from the
server. I pass in jpacket->x or jpacket->iq depending on whether I get
an iq packet or any other packet. But do I need to free something else
in addition to this and if so, what are the rules (if any) for freeing
memory allocated by the libraries for incoming packets.
Thanks,
Tim
More information about the JDev
mailing list