> I have implemented a parser pool (that is using the DOMParser via
> DocumentBuilder and DocumentBuilderFactory) java 1.4.2 and it seems
[quoted text clipped - 5 lines]
> My pool is using the DocumentBuilder API to get the parser instance
> and then caching that in the pool.
Don't do that. Seriously, there's no real advantage in it, and you
can see the disadvantages.
byoder@hotmail.com - 28 Feb 2008 07:07 GMT
On Feb 27, 7:20 pm, "Mike Schilling" <mscottschill...@hotmail.com>
wrote:
> byo...@hotmail.com wrote:
> > I have implemented a parser pool (that is using the DOMParser via
[quoted text clipped - 9 lines]
> Don't do that. Seriously, there's no real advantage in it, and you
> can see the disadvantages.
At this point I am inclined to agree with you. When I started the
DOMParser pool it actually did appear to improve performance (based on
my memory profiler and use case), but if it leaks memory then it is
not a viable option. The most frustrating thing is the lack of
documentation on this (xerces or apache) and that it doesn't clearly
say if the class cannot be shared by multiple threads and/or reused.
Thanks for the advice.