Re: possible memory leak issue in 1.2 dev (as of SVN:821662)

Natalia Shilenkova <[email protected]>
Newsgroups gmane.text.xml.xindice.devel
Message-ID <[email protected]>
Ferenc,

Thank you for reporting the problem. Could you please let me know what
OS and JVM version you use to run Xindice (please include all the
information "java -version" reports)?

I'll investigate the problem.

Regards,
Natalia

2009/10/21 Ferenc Pápai <[email protected]>:
>
>
> Hi
>
> I think I discovered a memory leak while an XPath query is executed using
> Xindice 1.2 dev svn revision number 821662.
>
> I only had to run a query that generated a sufficiently large number of
> results.
>
> After some debugging I discovered that in class XPathQueryResolver.ResultSet
> the XPathResolverContext member variable is cached now as opposed to as it
> was in its previous version.
> This is probably for performance reasons.
>
> This class XPathResolverContext has internally a DTMManager implementation.
> As ResultSet.prepareNextNode method is called many times (while one query is
> executed),  the DTMManager instance will grow and grow in size until JVM
> runs out of memory.
>
> Calling XPathResolverContext .reset() in ResultSet.prepareNextNode would
> solve this problem but it would be against the intent of optimizing the
> code.
>
>
> I am not familiar yet with Xalan's DTM API to provide a proper solution. So
> i am just speculating here:
> Internally DTMManager caches DTM objects generated while it executed the
> query on a given context. These DTMs consume the memory.
> I think these are cached to be reused by the two-way iterators provided by
> DTMManager.
> However in Xindice, the Collection API provides the NodeSet as forward only
> iterator, thus no DTM caching is need for Xindice. ?
>
>
> regards,
> Ferenc
>
>
>
>
>
>
>
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.