From himalay.gopu@openwave.com Thu Nov 16 11:36:43 2006 Return-Path: X-Original-To: gdome@gnome.org Delivered-To: gdome@gnome.org Received: from localhost (localhost.localdomain [127.0.0.1]) by menubar.gnome.org (Postfix) with ESMTP id 4AFC73B018D for ; Thu, 16 Nov 2006 11:36:43 -0500 (EST) Received: from menubar.gnome.org ([127.0.0.1]) by localhost (menubar.gnome.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 22560-07 for ; Thu, 16 Nov 2006 11:36:37 -0500 (EST) Received: from rwc-isa.openwave.com (mtarwc.openwave.com [12.25.200.46]) by menubar.gnome.org (Postfix) with ESMTP id 8762B3B010F for ; Thu, 16 Nov 2006 11:36:36 -0500 (EST) Received: from rwc-exch-prd1.myopwv.com ([10.16.249.141]) by rwc-isa.openwave.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 16 Nov 2006 08:36:35 -0800 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C7099D.616A003D" Date: Thu, 16 Nov 2006 08:36:37 -0800 Message-ID: <5B30129FAC49284A849F0C20F9E92D5C038336EF@rwc-exch-prd1.myopwv.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: gdome_di_createDocFromMemory Memory Leak Thread-Index: AccJnWL2wovX8P/eR5iqWOJMx/c2gw== From: "Himalay Gopu" To: X-OriginalArrivalTime: 16 Nov 2006 16:36:35.0359 (UTC) FILETIME=[617F32F0:01C7099D] X-Virus-Scanned: by amavisd-new at gnome.org X-Spam-Status: No, score=0.156 tagged_above=-999 required=2 tests=[BAYES_50=0.001, HTML_MESSAGE=0.001, TW_BX=0.077, TW_IB=0.077] X-Spam-Score: 0.156 X-Spam-Level: Subject: [gdome] gdome_di_createDocFromMemory Memory Leak X-BeenThere: gdome@gnome.org X-Mailman-Version: 2.1.8 Precedence: list List-Id: Gnome DOM development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Nov 2006 16:36:43 -0000 This is a multi-part message in MIME format. ------_=_NextPart_001_01C7099D.616A003D Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Hi =20 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 =20 But when we try to use gdome_di_createDocFromMemory there seems to be a memory leak almost 6144 bytes for every transaction =20 The leak starts from here =20 response_document =3D gdome_di_createDocFromMemory (domimpl, response.body, GDOME_LOAD_VALIDATING, &exception); =20 return ((Gdome_xml_DOMImplementation *)self)->vtab->createDocFromMemory (self, buffer, mode, exc); -> gdome.c =20 ret =3D (GdomeDocument *)gdome_xml_n_mkref ((xmlNode *)xmlParseMem ory (buffer, size)); - > gdome_xml-domimp.c =20 and then libxml.so =20 I am freeing up the memory used by xml doc (response_document) using gdome_doc_unref at the end of the each transaction =20 Is this a BUG in memory management of gdome? =20 I have compiled the code with newer versions of libxml and gdome still the memory leak exists =20 I am kind of struck at this stage=20 =20 Any help is appreciated =20 Thanks =20 =20 Himalay Gopu Openwave Systems Phone: 571 241 8006 =20 ------_=_NextPart_001_01C7099D.616A003D Content-Type: text/html; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable

Hi

 

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

 

response_document =3D gdome_di_createDocFromMemory = (domimpl, response.body, GDOME_LOAD_VALIDATING, = &exception);

 

return ((Gdome_xml_DOMImplementation *)self)->vtab->createDocFromMemory

(self, buffer, mode, exc); -> gdome.c

 

ret =3D (GdomeDocument *)gdome_xml_n_mkref ((xmlNode *)xmlParseMem

ory (buffer, size)); - > gdome_xml-domimp.c

 

and then libxml.so

 

I am freeing up the memory used by xml doc = (response_document) using

gdome_doc_unref at the end of the each = transaction

 

Is this a BUG in memory management of = gdome?

 

I have compiled the code with newer versions of = libxml and gdome still the memory leak exists

 

I am kind of struck at this stage =

 

Any help is appreciated

 

Thanks

 

 

Himalay Gopu

Openwave Systems

Phone: 571 241 8006

 

------_=_NextPart_001_01C7099D.616A003D-- From barbieri@gmail.com Thu Nov 16 20:25:35 2006 Return-Path: X-Original-To: gdome@gnome.org Delivered-To: gdome@gnome.org Received: from localhost (localhost.localdomain [127.0.0.1]) by menubar.gnome.org (Postfix) with ESMTP id BDA3A3B000E for ; Thu, 16 Nov 2006 20:25:35 -0500 (EST) Received: from menubar.gnome.org ([127.0.0.1]) by localhost (menubar.gnome.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 18052-01 for ; Thu, 16 Nov 2006 20:25:33 -0500 (EST) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.184]) by menubar.gnome.org (Postfix) with ESMTP id E661A3B0180 for ; Thu, 16 Nov 2006 20:25:32 -0500 (EST) Received: by nf-out-0910.google.com with SMTP id l36so1247226nfa for ; Thu, 16 Nov 2006 17:25:32 -0800 (PST) Received: by 10.78.193.19 with SMTP id q19mr1324085huf.1163726731328; Thu, 16 Nov 2006 17:25:31 -0800 (PST) Received: by 10.78.154.4 with HTTP; Thu, 16 Nov 2006 17:25:31 -0800 (PST) Message-ID: <9ef20ef30611161725i6b540c47gc4028fc68ec980a5@mail.gmail.com> Date: Thu, 16 Nov 2006 23:25:31 -0200 From: "Gustavo Sverzut Barbieri" To: "Himalay Gopu" In-Reply-To: <5B30129FAC49284A849F0C20F9E92D5C038336EF@rwc-exch-prd1.myopwv.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <5B30129FAC49284A849F0C20F9E92D5C038336EF@rwc-exch-prd1.myopwv.com> X-Virus-Scanned: by amavisd-new at gnome.org X-Spam-Status: No, score=-2.455 tagged_above=-999 required=2 tests=[AWL=-0.009, BAYES_00=-2.599, SPF_PASS=-0.001, TW_BX=0.077, TW_IB=0.077] X-Spam-Score: -2.455 X-Spam-Level: Cc: gdome@gnome.org Subject: Re: [gdome] gdome_di_createDocFromMemory Memory Leak X-BeenThere: gdome@gnome.org X-Mailman-Version: 2.1.8 Precedence: list List-Id: Gnome DOM development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Nov 2006 01:25:35 -0000 On 11/16/06, Himalay Gopu 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 From himalay.gopu@openwave.com Thu Nov 16 20:40:00 2006 Return-Path: X-Original-To: gdome@gnome.org Delivered-To: gdome@gnome.org Received: from localhost (localhost.localdomain [127.0.0.1]) by menubar.gnome.org (Postfix) with ESMTP id 4BFBD3B000E for ; Thu, 16 Nov 2006 20:40:00 -0500 (EST) Received: from menubar.gnome.org ([127.0.0.1]) by localhost (menubar.gnome.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 18374-08 for ; Thu, 16 Nov 2006 20:39:58 -0500 (EST) Received: from rwc-isa.openwave.com (mtarwc.openwave.com [12.25.200.46]) by menubar.gnome.org (Postfix) with ESMTP id 0FCE43B01D9 for ; Thu, 16 Nov 2006 20:39:58 -0500 (EST) Received: from rwc-exch-prd1.myopwv.com ([10.16.249.141]) by rwc-isa.openwave.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 16 Nov 2006 17:39:56 -0800 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Date: Thu, 16 Nov 2006 17:39:52 -0800 Message-ID: <5B30129FAC49284A849F0C20F9E92D5C03833B74@rwc-exch-prd1.myopwv.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [gnome] gdome_di_createDocFromMemory Memory Leak Thread-Index: AccJ50guqM/IfZ2US0O5pgQdk0LzZAAAIVUg From: "Himalay Gopu" To: "Gustavo Sverzut Barbieri" X-OriginalArrivalTime: 17 Nov 2006 01:39:56.0702 (UTC) FILETIME=[49695BE0:01C709E9] X-Virus-Scanned: by amavisd-new at gnome.org X-Spam-Status: No, score=-2.445 tagged_above=-999 required=2 tests=[BAYES_00=-2.599, TW_BX=0.077, TW_IB=0.077] X-Spam-Score: -2.445 X-Spam-Level: Cc: gdome@gnome.org Subject: Re: [gdome] [gnome] gdome_di_createDocFromMemory Memory Leak X-BeenThere: gdome@gnome.org X-Mailman-Version: 2.1.8 Precedence: list List-Id: Gnome DOM development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Nov 2006 01:40:00 -0000 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=20 Thanks Himalay -----Original Message----- From: Gustavo Sverzut Barbieri [mailto:barbieri@gmail.com]=20 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 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 =3D 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. :-) --=20 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 From barbieri@gmail.com Fri Nov 17 17:31:26 2006 Return-Path: X-Original-To: gdome@gnome.org Delivered-To: gdome@gnome.org Received: from localhost (localhost.localdomain [127.0.0.1]) by menubar.gnome.org (Postfix) with ESMTP id 4D4F53B013C for ; Fri, 17 Nov 2006 17:31:26 -0500 (EST) Received: from menubar.gnome.org ([127.0.0.1]) by localhost (menubar.gnome.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 22272-01 for ; Fri, 17 Nov 2006 17:31:22 -0500 (EST) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.191]) by menubar.gnome.org (Postfix) with ESMTP id B8B9E3B00BB for ; Fri, 17 Nov 2006 17:31:21 -0500 (EST) Received: by nf-out-0910.google.com with SMTP id l36so1582521nfa for ; Fri, 17 Nov 2006 14:31:19 -0800 (PST) Received: by 10.78.204.7 with SMTP id b7mr2451397hug.1163802678911; Fri, 17 Nov 2006 14:31:18 -0800 (PST) Received: by 10.78.154.4 with HTTP; Fri, 17 Nov 2006 14:31:18 -0800 (PST) Message-ID: <9ef20ef30611171431t7ec9e9cdg8210772202424eaf@mail.gmail.com> Date: Fri, 17 Nov 2006 20:31:18 -0200 From: "Gustavo Sverzut Barbieri" To: "Himalay Gopu" In-Reply-To: <5B30129FAC49284A849F0C20F9E92D5C03833B74@rwc-exch-prd1.myopwv.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <5B30129FAC49284A849F0C20F9E92D5C03833B74@rwc-exch-prd1.myopwv.com> X-Virus-Scanned: by amavisd-new at gnome.org X-Spam-Status: No, score=-2.532 tagged_above=-999 required=2 tests=[AWL=0.068, BAYES_00=-2.599, SPF_PASS=-0.001] X-Spam-Score: -2.532 X-Spam-Level: Cc: gdome@gnome.org Subject: Re: [gdome] [gnome] gdome_di_createDocFromMemory Memory Leak X-BeenThere: gdome@gnome.org X-Mailman-Version: 2.1.8 Precedence: list List-Id: Gnome DOM development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Nov 2006 22:31:26 -0000 On 11/16/06, Himalay Gopu wrote: > 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 weird... how are you creatinga singleton for every transaction? Singletons should be... singletons, single instances. > BTW what are the singleton classes in gdome -- GdomeDOMImplementation > Does making these classes singleton hinder the performance of the > application in threaded environment? the singletons here are just the vtable stuff, used to dispatch the methods. It could be done in other ways, like static or even better gdome guys could use c++ and let compiler does that. -- 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 From himalay.gopu@openwave.com Thu Nov 16 11:36:43 2006 Return-Path: X-Original-To: gdome@gnome.org Delivered-To: gdome@gnome.org Received: from localhost (localhost.localdomain [127.0.0.1]) by menubar.gnome.org (Postfix) with ESMTP id 4AFC73B018D for ; Thu, 16 Nov 2006 11:36:43 -0500 (EST) Received: from menubar.gnome.org ([127.0.0.1]) by localhost (menubar.gnome.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 22560-07 for ; Thu, 16 Nov 2006 11:36:37 -0500 (EST) Received: from rwc-isa.openwave.com (mtarwc.openwave.com [12.25.200.46]) by menubar.gnome.org (Postfix) with ESMTP id 8762B3B010F for ; Thu, 16 Nov 2006 11:36:36 -0500 (EST) Received: from rwc-exch-prd1.myopwv.com ([10.16.249.141]) by rwc-isa.openwave.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 16 Nov 2006 08:36:35 -0800 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C7099D.616A003D" Date: Thu, 16 Nov 2006 08:36:37 -0800 Message-ID: <5B30129FAC49284A849F0C20F9E92D5C038336EF@rwc-exch-prd1.myopwv.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: gdome_di_createDocFromMemory Memory Leak Thread-Index: AccJnWL2wovX8P/eR5iqWOJMx/c2gw== From: "Himalay Gopu" To: X-OriginalArrivalTime: 16 Nov 2006 16:36:35.0359 (UTC) FILETIME=[617F32F0:01C7099D] X-Virus-Scanned: by amavisd-new at gnome.org X-Spam-Status: No, score=0.156 tagged_above=-999 required=2 tests=[BAYES_50=0.001, HTML_MESSAGE=0.001, TW_BX=0.077, TW_IB=0.077] X-Spam-Score: 0.156 X-Spam-Level: Subject: [gdome] gdome_di_createDocFromMemory Memory Leak X-BeenThere: gdome@gnome.org X-Mailman-Version: 2.1.8 Precedence: list List-Id: Gnome DOM development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Nov 2006 16:36:43 -0000 This is a multi-part message in MIME format. ------_=_NextPart_001_01C7099D.616A003D Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Hi =20 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 =20 But when we try to use gdome_di_createDocFromMemory there seems to be a memory leak almost 6144 bytes for every transaction =20 The leak starts from here =20 response_document =3D gdome_di_createDocFromMemory (domimpl, response.body, GDOME_LOAD_VALIDATING, &exception); =20 return ((Gdome_xml_DOMImplementation *)self)->vtab->createDocFromMemory (self, buffer, mode, exc); -> gdome.c =20 ret =3D (GdomeDocument *)gdome_xml_n_mkref ((xmlNode *)xmlParseMem ory (buffer, size)); - > gdome_xml-domimp.c =20 and then libxml.so =20 I am freeing up the memory used by xml doc (response_document) using gdome_doc_unref at the end of the each transaction =20 Is this a BUG in memory management of gdome? =20 I have compiled the code with newer versions of libxml and gdome still the memory leak exists =20 I am kind of struck at this stage=20 =20 Any help is appreciated =20 Thanks =20 =20 Himalay Gopu Openwave Systems Phone: 571 241 8006 =20 ------_=_NextPart_001_01C7099D.616A003D Content-Type: text/html; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable

Hi

 

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

 

response_document =3D gdome_di_createDocFromMemory = (domimpl, response.body, GDOME_LOAD_VALIDATING, = &exception);

 

return ((Gdome_xml_DOMImplementation *)self)->vtab->createDocFromMemory

(self, buffer, mode, exc); -> gdome.c

 

ret =3D (GdomeDocument *)gdome_xml_n_mkref ((xmlNode *)xmlParseMem

ory (buffer, size)); - > gdome_xml-domimp.c

 

and then libxml.so

 

I am freeing up the memory used by xml doc = (response_document) using

gdome_doc_unref at the end of the each = transaction

 

Is this a BUG in memory management of = gdome?

 

I have compiled the code with newer versions of = libxml and gdome still the memory leak exists

 

I am kind of struck at this stage =

 

Any help is appreciated

 

Thanks

 

 

Himalay Gopu

Openwave Systems

Phone: 571 241 8006

 

------_=_NextPart_001_01C7099D.616A003D-- From barbieri@gmail.com Thu Nov 16 20:25:35 2006 Return-Path: X-Original-To: gdome@gnome.org Delivered-To: gdome@gnome.org Received: from localhost (localhost.localdomain [127.0.0.1]) by menubar.gnome.org (Postfix) with ESMTP id BDA3A3B000E for ; Thu, 16 Nov 2006 20:25:35 -0500 (EST) Received: from menubar.gnome.org ([127.0.0.1]) by localhost (menubar.gnome.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 18052-01 for ; Thu, 16 Nov 2006 20:25:33 -0500 (EST) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.184]) by menubar.gnome.org (Postfix) with ESMTP id E661A3B0180 for ; Thu, 16 Nov 2006 20:25:32 -0500 (EST) Received: by nf-out-0910.google.com with SMTP id l36so1247226nfa for ; Thu, 16 Nov 2006 17:25:32 -0800 (PST) Received: by 10.78.193.19 with SMTP id q19mr1324085huf.1163726731328; Thu, 16 Nov 2006 17:25:31 -0800 (PST) Received: by 10.78.154.4 with HTTP; Thu, 16 Nov 2006 17:25:31 -0800 (PST) Message-ID: <9ef20ef30611161725i6b540c47gc4028fc68ec980a5@mail.gmail.com> Date: Thu, 16 Nov 2006 23:25:31 -0200 From: "Gustavo Sverzut Barbieri" To: "Himalay Gopu" In-Reply-To: <5B30129FAC49284A849F0C20F9E92D5C038336EF@rwc-exch-prd1.myopwv.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <5B30129FAC49284A849F0C20F9E92D5C038336EF@rwc-exch-prd1.myopwv.com> X-Virus-Scanned: by amavisd-new at gnome.org X-Spam-Status: No, score=-2.455 tagged_above=-999 required=2 tests=[AWL=-0.009, BAYES_00=-2.599, SPF_PASS=-0.001, TW_BX=0.077, TW_IB=0.077] X-Spam-Score: -2.455 X-Spam-Level: Cc: gdome@gnome.org Subject: Re: [gdome] gdome_di_createDocFromMemory Memory Leak X-BeenThere: gdome@gnome.org X-Mailman-Version: 2.1.8 Precedence: list List-Id: Gnome DOM development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Nov 2006 01:25:35 -0000 On 11/16/06, Himalay Gopu 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 From himalay.gopu@openwave.com Thu Nov 16 20:40:00 2006 Return-Path: X-Original-To: gdome@gnome.org Delivered-To: gdome@gnome.org Received: from localhost (localhost.localdomain [127.0.0.1]) by menubar.gnome.org (Postfix) with ESMTP id 4BFBD3B000E for ; Thu, 16 Nov 2006 20:40:00 -0500 (EST) Received: from menubar.gnome.org ([127.0.0.1]) by localhost (menubar.gnome.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 18374-08 for ; Thu, 16 Nov 2006 20:39:58 -0500 (EST) Received: from rwc-isa.openwave.com (mtarwc.openwave.com [12.25.200.46]) by menubar.gnome.org (Postfix) with ESMTP id 0FCE43B01D9 for ; Thu, 16 Nov 2006 20:39:58 -0500 (EST) Received: from rwc-exch-prd1.myopwv.com ([10.16.249.141]) by rwc-isa.openwave.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 16 Nov 2006 17:39:56 -0800 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Date: Thu, 16 Nov 2006 17:39:52 -0800 Message-ID: <5B30129FAC49284A849F0C20F9E92D5C03833B74@rwc-exch-prd1.myopwv.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [gnome] gdome_di_createDocFromMemory Memory Leak Thread-Index: AccJ50guqM/IfZ2US0O5pgQdk0LzZAAAIVUg From: "Himalay Gopu" To: "Gustavo Sverzut Barbieri" X-OriginalArrivalTime: 17 Nov 2006 01:39:56.0702 (UTC) FILETIME=[49695BE0:01C709E9] X-Virus-Scanned: by amavisd-new at gnome.org X-Spam-Status: No, score=-2.445 tagged_above=-999 required=2 tests=[BAYES_00=-2.599, TW_BX=0.077, TW_IB=0.077] X-Spam-Score: -2.445 X-Spam-Level: Cc: gdome@gnome.org Subject: Re: [gdome] [gnome] gdome_di_createDocFromMemory Memory Leak X-BeenThere: gdome@gnome.org X-Mailman-Version: 2.1.8 Precedence: list List-Id: Gnome DOM development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Nov 2006 01:40:00 -0000 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=20 Thanks Himalay -----Original Message----- From: Gustavo Sverzut Barbieri [mailto:barbieri@gmail.com]=20 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 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 =3D 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. :-) --=20 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 From barbieri@gmail.com Fri Nov 17 17:31:26 2006 Return-Path: X-Original-To: gdome@gnome.org Delivered-To: gdome@gnome.org Received: from localhost (localhost.localdomain [127.0.0.1]) by menubar.gnome.org (Postfix) with ESMTP id 4D4F53B013C for ; Fri, 17 Nov 2006 17:31:26 -0500 (EST) Received: from menubar.gnome.org ([127.0.0.1]) by localhost (menubar.gnome.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 22272-01 for ; Fri, 17 Nov 2006 17:31:22 -0500 (EST) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.191]) by menubar.gnome.org (Postfix) with ESMTP id B8B9E3B00BB for ; Fri, 17 Nov 2006 17:31:21 -0500 (EST) Received: by nf-out-0910.google.com with SMTP id l36so1582521nfa for ; Fri, 17 Nov 2006 14:31:19 -0800 (PST) Received: by 10.78.204.7 with SMTP id b7mr2451397hug.1163802678911; Fri, 17 Nov 2006 14:31:18 -0800 (PST) Received: by 10.78.154.4 with HTTP; Fri, 17 Nov 2006 14:31:18 -0800 (PST) Message-ID: <9ef20ef30611171431t7ec9e9cdg8210772202424eaf@mail.gmail.com> Date: Fri, 17 Nov 2006 20:31:18 -0200 From: "Gustavo Sverzut Barbieri" To: "Himalay Gopu" In-Reply-To: <5B30129FAC49284A849F0C20F9E92D5C03833B74@rwc-exch-prd1.myopwv.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <5B30129FAC49284A849F0C20F9E92D5C03833B74@rwc-exch-prd1.myopwv.com> X-Virus-Scanned: by amavisd-new at gnome.org X-Spam-Status: No, score=-2.532 tagged_above=-999 required=2 tests=[AWL=0.068, BAYES_00=-2.599, SPF_PASS=-0.001] X-Spam-Score: -2.532 X-Spam-Level: Cc: gdome@gnome.org Subject: Re: [gdome] [gnome] gdome_di_createDocFromMemory Memory Leak X-BeenThere: gdome@gnome.org X-Mailman-Version: 2.1.8 Precedence: list List-Id: Gnome DOM development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Nov 2006 22:31:26 -0000 On 11/16/06, Himalay Gopu wrote: > 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 weird... how are you creatinga singleton for every transaction? Singletons should be... singletons, single instances. > BTW what are the singleton classes in gdome -- GdomeDOMImplementation > Does making these classes singleton hinder the performance of the > application in threaded environment? the singletons here are just the vtable stuff, used to dispatch the methods. It could be done in other ways, like static or even better gdome guys could use c++ and let compiler does that. -- 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