Re: [gdome] [gnome] gdome_di_createDocFromMemory Memory Leak



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:barbieri gmail com] 
Sent: Thursday, November 16, 2006 8:26 PM
To: Himalay Gopu
Cc: gdome gnome org
Subject: Re: [gdome] gdome_di_createDocFromMemory Memory Leak

On 11/16/06, Himalay Gopu <Himalay Gopu openwave com> 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: barbieri gmail com
   MSN: barbieri gmail com
  ICQ#: 17249123
 Skype: gsbarbieri
Mobile: +55 (81) 9927 0010
 Phone:  +1 (347) 624 6296; 08122692 sip stanaphone com
   GPG: 0xB640E1A2 @ wwwkeys.pgp.net



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