Hi Michael, 

Thanks a lot to make this change still in Xerces 2.8.1.
I've retested today with the new version and I now don't see the (big)
leaks anymore.

In fact with Jprofiler I do still see some small leak on the
LSParser.parse (17KB for 476 parse operations) but that's not due to my
re-use of the parser instances via a pool anymore (as I see the same
results if create a new parser locally to my method each time).

If you want I can digg some more into this and put my findings in a JIRA
fiche.

Kr,
Wim

-----Original Message-----
From: Michael Glavassevich [mailto:[EMAIL PROTECTED] 
Sent: woensdag 13 september 2006 20:38
To: j-users@xerces.apache.org
Subject: Re: Pooling LSParsers for performance reasons

"BERVOETS Wim" <[EMAIL PROTECTED]> wrote on 09/13/2006 05:34:39 AM:

> Hi all,
> 
> I would like to keep a pool of LSParsers objects which can be used by 
> my application for parsing XML.
> I'm using Commons Pool for the implementation of the pool where I'm 
> using a BaseKeyedPoolableObjectFactory for creating the LSInputs, 
> LSOutputs, LSSerializers and LSParsers.
> 
> It works nicely and much faster as I don't have to create the parser 
> object anymore but I'm seeing that some memory is leaking on the 
> LSParsers. (it seems the xml document I parsed with it stays in memory

> when I put back the LSParser object in the pool)
> 
> I guess this is normal because I couldn't find any sort of clear() or 
> reset() method on the LS* objects.
> 
> I would like to know if it's possible to add some kind of clear()
> /reset() method on the LS* objects which I can call when I return the 
> LS* objects back to the pool ?

The Xerces implementation of LSParser has a reset() method but it isn't
part of the DOM interface. You won't need to call that though. I just
modified Xerces' LSParser (and DocumentBuilder) so that they drop their
internal references to the DOM they just built. This will make it into
Xerces 2.8.1 which should be available some time tonight.

> kind regards,
> Wim Bervoets

Thanks.

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: [EMAIL PROTECTED]
E-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-----Disclaimer-----

This message may contain confidential information intended solely for the use 
of the named addressee. If you are not the intended recipient, you should not 
read, use, disclose or reproduce the content of this message. If you have 
received this message by mistake, please notify the sender immediately. Any 
views or opinions presented in this message are solely those of the author and 
do not necessarily represent those of AXA Belgium, AXA Bank Belgium, AXA Tech 
Belgium GIE - ESV or any other entity of the AXA Group, unless otherwise stated 
by the sender and duly authorized by the said companies.

---------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to