As recommended, I enabled the full DOM expansion i.e. set the
defer-node-expansion property to false and executed the same code.
While processing time seemed constant, there was a huge memory leak with
the JVM dying out after reaching 1.5 GB.  I have checked to see that
there are no leaks in my test code.  It seems that the CachedXPathAPI
methods using Xalan 2.2 are leaking memory.  Could someone explain to me
if I am missing something?

Thanks,
Karthik

-----Original Message-----
From: Elena Litani [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 07, 2002 11:07 AM
To: [EMAIL PROTECTED]
Subject: Re: Performance Problems using large XML DOM and XPath


"Raghavendra, Karthik" wrote:
> I then reversed the loop
> in the main method to start from the last product record (14800) and
> noticed that the processing time was 77 seconds.  However, it dropped
> significantly after a few iterations (100 records) to about 25
seconds.
 
> What I do not understand is the reason for this increase in processing
> time.  

In Xerces by default uses deferred DOM - the parser creates a compact
structure corresponding to the DOM in memory, and it does not create any
nodes. The nodes are created when user tries to access one of the nodes.

In your example, you are trying to access the last product record and it
triggers the fluffing of the tree - the Xerces DOM implementation is
trying to create all nodes in memory that have a path to the node that
you are trying to access. Given the size of the document, it takes a
long time.

On the other hand, over time your tree becomes more and more expanded
(since you access more and more nodes) and processing time drops
significantly.

If memory is not a concern to you, you might want to turn off the
deferred node expansion
("http://apache.org/xml/features/dom/defer-node-expansion";), so that
parser creates the full DOM tree in memory. The processing time for
access should drop in this case.



-- 
Elena Litani / IBM Toronto

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

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

Reply via email to