You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by Alberto Massari <am...@datadirect.com> on 2008/03/10 15:26:14 UTC

Re: FW: DOMDocument::importNode and memory leak on solaris

Anurag,
if the same code works on Linux, it could be that Solaris has a 
different policy in releasing the memory. Xerces is not doing anything 
special other than releasing the memory it allocated.

Alberto

Anurag Jain wrote:
>
> Not able to reach c-dev users ..c-users..
>
> Please help .
>
> Alberto and Boris ,
> Please see below with details of  how to reproduce this.
>
> Thanks
> -Anurag
>
>     ------------------------------------------------------------------------
>
>
>         ------------------------------------------------------------------------
>         From: anuragjain026@hotmail.com
>         To: c-dev@xerces.apache.org
>         Subject: RE: DOMDocument::importNode and memory leak on solaris
>         Date: Mon, 10 Mar 2008 08:10:32 -0500
>
>         Alberto and Boris,
>
>         Thanks for your reply , I am releasing the dom document..but
>         that does not help I am attaching the example code (attached
>         and also pasted below ) and the way to reproduce .
>
>         The way to run this program is (I have attached the xml also
>         for your use ) ./xtesterd //ARPTable.xml 20 with a loop count
>         of 20 the memory footprint on SOLARIS (SunOS 5.10
>         Generic_118833-17 sun4u sparc SUNW,Sun-Fire-V240) is around 45
>         M (check with top during the run )and does not get released ,
>         grows with larger counts NOTE : I notice the memory does get
>         released on Redhat linux on the dom document release Please
>         let me know.
>
>         Thanks -Anurag
>



Re: DOMDocument::importNode and memory leak on solaris

Posted by David Bertoni <db...@apache.org>.
Anurag Jain wrote:
> Boris,
> 
> I corrected the missing delete []buf ; that you pointed out but that does not help on solaris as expected.
> 
> Alberto / Boris , 
> 
>     Since  there is an issue with this code on Solaris  ? ,  can you suggest any alternative xerces APIs/code snippet to get the 
> same DOMDocument::importNode functionality that possibly will prevent the leak. 
As both Alberto and Boris stated, this is not a leak.  Solaris probably has 
different memory caching algorithm for the C/C++ run-time heap.

Perhaps you should do some research on Sun's web site to see if there are 
any system APIs that control this behavior.

Dave

RE: DOMDocument::importNode and memory leak on solaris

Posted by Anurag Jain <an...@hotmail.com>.
Boris,

I corrected the missing delete []buf ; that you pointed out but that does not help on solaris as expected.

Alberto / Boris , 

    Since  there is an issue with this code on Solaris  ? ,  can you suggest any alternative xerces APIs/code snippet to get the 
same DOMDocument::importNode functionality that possibly will prevent the leak. 

We are investigating the same.

Thanks for your quick replies . Your expert advice would be very helpful.
Anurag


> Date: Mon, 10 Mar 2008 15:26:14 +0100
> From: amassari@datadirect.com
> To: anuragjain026@hotmail.com
> CC: c-users@xerces.apache.org
> Subject: Re: FW: DOMDocument::importNode and memory leak on solaris
> 
> Anurag,
> if the same code works on Linux, it could be that Solaris has a 
> different policy in releasing the memory. Xerces is not doing anything 
> special other than releasing the memory it allocated.
> 
> Alberto
> 
> Anurag Jain wrote:
> >
> > Not able to reach c-dev users ..c-users..
> >
> > Please help .
> >
> > Alberto and Boris ,
> > Please see below with details of  how to reproduce this.
> >
> > Thanks
> > -Anurag
> >
> >     ------------------------------------------------------------------------
> >
> >
> >         ------------------------------------------------------------------------
> >         From: anuragjain026@hotmail.com
> >         To: c-dev@xerces.apache.org
> >         Subject: RE: DOMDocument::importNode and memory leak on solaris
> >         Date: Mon, 10 Mar 2008 08:10:32 -0500
> >
> >         Alberto and Boris,
> >
> >         Thanks for your reply , I am releasing the dom document..but
> >         that does not help I am attaching the example code (attached
> >         and also pasted below ) and the way to reproduce .
> >
> >         The way to run this program is (I have attached the xml also
> >         for your use ) ./xtesterd //ARPTable.xml 20 with a loop count
> >         of 20 the memory footprint on SOLARIS (SunOS 5.10
> >         Generic_118833-17 sun4u sparc SUNW,Sun-Fire-V240) is around 45
> >         M (check with top during the run )and does not get released ,
> >         grows with larger counts NOTE : I notice the memory does get
> >         released on Redhat linux on the dom document release Please
> >         let me know.
> >
> >         Thanks -Anurag
> >
> 
> 

_________________________________________________________________
Need to know the score, the latest news, or you need your HotmailĀ®-get your "fix".
http://www.msnmobilefix.com/Default.aspx