<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Memory leak when using Xerces C++ in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/memory-leak-when-using-xerces-c/m-p/3614524#M639908</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I found a memory leak when using Xerces C++ XML Parser in error cases (e.g. file not found). I reported this problem to Xerces (project within Apache Software Foundation), but got a response indicating that this is not a bug in Xerces, but in HP-UX.&lt;BR /&gt;&lt;BR /&gt;More information can be found here&lt;BR /&gt;&lt;A href="http://issues.apache.org/jira/browse/XERCESC-1486" target="_blank"&gt;http://issues.apache.org/jira/browse/XERCESC-1486&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I verified the memory leaks with both purify and wdb's built-in memory checker. Both report the same problem. Attached you can find the entire source code (just a few lines).&lt;BR /&gt;&lt;BR /&gt;Question is: has somebody heard about similar memory leaks?&lt;BR /&gt;&lt;BR /&gt;My environment:&lt;BR /&gt;HP-UX B.11.11 U 9000/800&lt;BR /&gt;aCC: HP ANSI C++ B3910B A.03.57&lt;BR /&gt;Xerces C++ 2.6 (available here &lt;A href="http://xml.apache.org/xerces-c/download.cgi)" target="_blank"&gt;http://xml.apache.org/xerces-c/download.cgi)&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Any help is highly appreciated!&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Stephan&lt;BR /&gt;</description>
    <pubDate>Tue, 30 Aug 2005 05:24:28 GMT</pubDate>
    <dc:creator>Stephan Irrgang</dc:creator>
    <dc:date>2005-08-30T05:24:28Z</dc:date>
    <item>
      <title>Memory leak when using Xerces C++</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/memory-leak-when-using-xerces-c/m-p/3614524#M639908</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I found a memory leak when using Xerces C++ XML Parser in error cases (e.g. file not found). I reported this problem to Xerces (project within Apache Software Foundation), but got a response indicating that this is not a bug in Xerces, but in HP-UX.&lt;BR /&gt;&lt;BR /&gt;More information can be found here&lt;BR /&gt;&lt;A href="http://issues.apache.org/jira/browse/XERCESC-1486" target="_blank"&gt;http://issues.apache.org/jira/browse/XERCESC-1486&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I verified the memory leaks with both purify and wdb's built-in memory checker. Both report the same problem. Attached you can find the entire source code (just a few lines).&lt;BR /&gt;&lt;BR /&gt;Question is: has somebody heard about similar memory leaks?&lt;BR /&gt;&lt;BR /&gt;My environment:&lt;BR /&gt;HP-UX B.11.11 U 9000/800&lt;BR /&gt;aCC: HP ANSI C++ B3910B A.03.57&lt;BR /&gt;Xerces C++ 2.6 (available here &lt;A href="http://xml.apache.org/xerces-c/download.cgi)" target="_blank"&gt;http://xml.apache.org/xerces-c/download.cgi)&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Any help is highly appreciated!&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Stephan&lt;BR /&gt;</description>
      <pubDate>Tue, 30 Aug 2005 05:24:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/memory-leak-when-using-xerces-c/m-p/3614524#M639908</guid>
      <dc:creator>Stephan Irrgang</dc:creator>
      <dc:date>2005-08-30T05:24:28Z</dc:date>
    </item>
    <item>
      <title>Re: Memory leak when using Xerces C++</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/memory-leak-when-using-xerces-c/m-p/3614525#M639909</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;1)check the source of the leak via&lt;BR /&gt;&lt;BR /&gt;ftp://eh:spear9@hprc.external.hp.com/memory.htm&lt;BR /&gt;&lt;BR /&gt;2)Make sure your patches are up to date since these things are getting fixed regularly.&lt;BR /&gt;&lt;BR /&gt;3)This sounds like a bug caused by the way Xerxes accesses HP&lt;BR /&gt;&lt;BR /&gt;                Steve Steel</description>
      <pubDate>Tue, 30 Aug 2005 08:12:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/memory-leak-when-using-xerces-c/m-p/3614525#M639909</guid>
      <dc:creator>Steve Steel</dc:creator>
      <dc:date>2005-08-30T08:12:14Z</dc:date>
    </item>
    <item>
      <title>Re: Memory leak when using Xerces C++</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/memory-leak-when-using-xerces-c/m-p/3614526#M639910</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;thanks Steve, now I know that Data VSS memory area is growing. However, I guess that doesn't help me much, does it?&lt;BR /&gt;&lt;BR /&gt;Reason for the memory leak is that memory allocated in an exception object is not released; somehow the destructor of that exception object is not called. I haven't read anything in the patch database about that issue, so I don't know whether updating to latest patch-level will help. Furthermore, it's not that easy to install patches in a big organization, where only few have root privileges ;-)&lt;BR /&gt;&lt;BR /&gt;On the comment that this an error in how Xerces is accessing HP: I guess I have to disagree on that. I had a look at the source code, and it looks ok: just an exception, which is thrown, and which is obviously not destroyed properly - on HP-UX, that is.&lt;BR /&gt;&lt;BR /&gt;Any other ideas?&lt;BR /&gt;&lt;BR /&gt;Stephan</description>
      <pubDate>Tue, 30 Aug 2005 10:01:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/memory-leak-when-using-xerces-c/m-p/3614526#M639910</guid>
      <dc:creator>Stephan Irrgang</dc:creator>
      <dc:date>2005-08-30T10:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: Memory leak when using Xerces C++</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/memory-leak-when-using-xerces-c/m-p/3614527#M639911</link>
      <description>Just an observation, should you really be throwing a local variable? (chBuffer in myCallbackHandler_c)</description>
      <pubDate>Wed, 31 Aug 2005 06:12:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/memory-leak-when-using-xerces-c/m-p/3614527#M639911</guid>
      <dc:creator>Stephen Keane</dc:creator>
      <dc:date>2005-08-31T06:12:29Z</dc:date>
    </item>
    <item>
      <title>Re: Memory leak when using Xerces C++</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/memory-leak-when-using-xerces-c/m-p/3614528#M639912</link>
      <description>I don't see a reason why not to throw a local variable. Moreover, it's not that character buffer, which isn't destroyed correctly, it's the SAXParseException, which is thrown somewhere else. All that stuff (throwing the exception, catching it, and passing it to the registered error handler myCallbackHandler_c) is implemented within Xerces C++ parser.</description>
      <pubDate>Wed, 31 Aug 2005 07:15:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/memory-leak-when-using-xerces-c/m-p/3614528#M639912</guid>
      <dc:creator>Stephan Irrgang</dc:creator>
      <dc:date>2005-08-31T07:15:15Z</dc:date>
    </item>
    <item>
      <title>Re: Memory leak when using Xerces C++</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/memory-leak-when-using-xerces-c/m-p/3614529#M639913</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;What is your patch level. There are lots of fixes in the latest ones&lt;BR /&gt;&lt;BR /&gt;example&lt;BR /&gt;Patch Name: PHKL_33372&lt;BR /&gt;&lt;BR /&gt;Patch Description: s700_800 11.11 Cumulative VM, Psets, Preemption, PRM, MRG&lt;BR /&gt;vhand is not paging out large pages and as a result system&lt;BR /&gt; hangs under memory pressure.&lt;BR /&gt;&lt;BR /&gt;PHNE_33159               &lt;BR /&gt;s700_800 11.11 cumulative ARPA Transport patch&lt;BR /&gt; Memory leak when using socketpair(2) call on&lt;BR /&gt; AF_UNIX domain sockets.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;                Steve Steel&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;We could be fishing for a known problem&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;              Steve Steel</description>
      <pubDate>Wed, 31 Aug 2005 07:44:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/memory-leak-when-using-xerces-c/m-p/3614529#M639913</guid>
      <dc:creator>Steve Steel</dc:creator>
      <dc:date>2005-08-31T07:44:36Z</dc:date>
    </item>
    <item>
      <title>Re: Memory leak when using Xerces C++</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/memory-leak-when-using-xerces-c/m-p/5426845#M639914</link>
      <description>&lt;P&gt;&amp;gt;Attached you can find the entire source code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately the leak is in the Xerces code and not in the example you provided.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did find a similar leak in EH exceptions but that was on Integrity only and with a 7+ year old aCC5 compiler.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MemoryManagerImpl::allocate(unsigned long) [libxerces-c.sl.26.0]&lt;/P&gt;&lt;P&gt;XMLException::XMLException(const xercesc_2_6::XMLException &amp;amp;)%2 [libxerces-c.sl.26.0] IGXMLScanner::scanReset(const xercesc_2_6::InputSource &amp;amp;) [libxerces-c.sl.26.0]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;Reason for the memory leak is that memory allocated in an exception object is not released; somehow the destructor of that exception object is not called.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically what is scanReset doing with this&amp;nbsp;XMLException object and does the destructor clean up what&amp;nbsp;allocate allocated?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;I had a look at the source code: just an exception, which is thrown, and which is obviously not destroyed properly&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It would help to have a snip of that.&amp;nbsp; Also, do you know where it caught?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;should you really be throwing a local variable? (chBuffer in myCallbackHandler_c)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That's correct, that's illegal.&amp;nbsp; While you can throw local variables, you can't throw a pointer to them.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;I don't see a reason why not to throw a local variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Because the buffer will be out of scope.&amp;nbsp; While that works on PA-RISC (since the exception object is allocated in that same frame), it fails on Integrity.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;All that stuff (throwing the exception, catching it, and passing it to the registered error handler myCallbackHandler_c) is implemented within Xerces C++ parser.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And that's the code that needs to be investigated.&lt;/P&gt;&lt;P&gt;Is SAXParseException derived from&amp;nbsp;XMLException?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;What is your patch level. There are lots of fixes in the latest ones&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;These are not aC++ runtime patches.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2011 11:29:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/memory-leak-when-using-xerces-c/m-p/5426845#M639914</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-12-23T11:29:43Z</dc:date>
    </item>
  </channel>
</rss>

