Actually I tested with a file with repeating element and attribute values.
DOM application monitored using DOMCount grew to almost three times the
size. 20MB XML file took 75MB in memory.
Am I missing something?
Kiran



-----Original Message-----
From: Bagepalli, Kiran [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 19, 2002 10:57 AM
To: '[EMAIL PROTECTED]'
Subject: RE: Memory growth in DOM


Following up on the question, if the element data and attributes are string
pooled, are they reference counted as well.

Say I have a DOM Tree, two parts of a DOM tree use data from the string
pool. If I release the first part, is the pool clever enough to retain the
strings in the pool. If the second part is deleted, are the strings in the
string pool marked to be reused.

This is important because, if I release all nodes using some strings in the
string pool, they should be reclaimed.
My question is, is the string pool always growing as long as the DOM
document stays alive.

As another example, lets assume I build a DOM, maybe 20MB element data in
memory. Do you intend to say, if I release all nodes, except the root
node(document), my memory usage will still show 20MB. Are there any
functions to reduce the block size or reclaim memory.

Thanks
Kiran
        

-----Original Message-----
From: Gareth Reakes [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 19, 2002 12:45 AM
To: '[EMAIL PROTECTED]'
Subject: Re: Memory growth in DOM


Hi,

> I had posted this question in the past with no reply. What kind of
> approach does xerces code employ when managing DOM data.

It allocates blocks of memory that are managed by the document. Some of 
these are recycled.

>       I believe the element/attribute values are in a string pool.
Yes.

>       Is it the same with the element/attribute data also.

Yes.

>       If the element data is stringpooled, then even after deleting the
> DOM Node does the element data still persist in the string pool?

After calling release on a node the memory is marked so that it can be 
recycled. Other data from the node (such as things created using 
getPooledString and things newed in constructors such as DOMAttrMapImpl) 
are currently only released when the document is released.

>       How can I reclaim this memory.

The nodes via release on them. The other data by deleting the document.

>       
>       Should I employ the dumb way and set all the node values to empty so
> that whatever was stored
>       before will be deleted?

This will not have any effect.

hope this clears it up.


Gareth


-- 
Gareth Reakes, Head of Product Development  
DecisionSoft Ltd.            http://www.decisionsoft.com
Office: +44 (0) 1865 203192



---------------------------------------------------------------------
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]

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

Reply via email to