Re: [gnome] gdome_di_createDocFromMemory Memory Leak

"Himalay Gopu" <[email protected]> Thu, 16 Nov 2006 17:39:52 -0800
Newsgroups gmane.comp.gnome.gdome
Message-ID <5B30129FAC49284A849F0C20F9E92D5C03833B74@rwc-exch-prd1.myopwv.com>
Thanks Gustavo

We have a function which creates the singleton for every transaction and
processes the XML so this should be causing the leak -- AM I RIGHT

BTW what are the singleton classes in gdome -- GdomeDOMImplementation
Does making these classes singleton hinder the performance of the
application in threaded environment?

I will try out recompiling the libs and test 

Thanks
Himalay
-----Original Message-----
From: Gustavo Sverzut Barbieri [mailto:[email protected]] 
Sent: Thursday, November 16, 2006 8:26 PM
To: Himalay Gopu
Cc: [email protected]
Subject: Re: [gdome] gdome_di_createDocFromMemory Memory Leak

On 11/16/06, Himalay Gopu <[email protected]> wrote:
> We are developing a threaded module (15 transactions per second) with
gdome
> and we need to get the xml from memory and parse the same
>
> But when we try to use gdome_di_createDocFromMemory there seems to be
a
> memory leak almost 6144 bytes for every transaction
>
> The leak starts from here

Some points:
 - gdome is not thread safe. while using it in a threaded environment,
I've found some bugs, one of them is creating singletons. I fixed the
one that did hurt at that point, but it was not making it thread safe,
instead I reordered the instructions so it would leak, but not crash.
Anyway, this shouldn't be the case, since the singleton is just
created once, and you may get no more than just few leaks (between:
'create singleton instance' and  'global = singleton-instance')
 - gdome uses glib and libxml  and they do their own memory management
and do cache. You need to compile these with options like
--enable-gc-friendly and --disable-mem-pool, see Glib user guide and
look at 'running glib applications', something like 'G_SLICER'

then you need to recheck your tests. :-)

-- 
Gustavo Sverzut Barbieri
--------------------------------------
Jabber: [email protected]
   MSN: [email protected]
  ICQ#: 17249123
 Skype: gsbarbieri
Mobile: +55 (81) 9927 0010
 Phone:  +1 (347) 624 6296; [email protected]
   GPG: 0xB640E1A2 @ wwwkeys.pgp.net