You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "Bagepalli, Kiran" <kb...@informatica.com> on 2002/11/19 03:53:49 UTC

Memory growth in DOM

I had posted this question in the past with no reply.
	What kind of approach does xerces code employ when managing DOM
data.
	I believe the element/attribute values are in a string pool.
	Is it the same with the element/attribute data also.
	
	Essentially I want a manage a huge DOM in memory. I would need to
swap
	this to disk and read and construct it back. 
	If the element data is stringpooled, then even after deleting the
DOM Node does the
	element data still persist in the string pool?
	How can I reclaim this memory.
	
	Should I employ the dumb way and set all the node values to empty so
that whatever was stored
	before will be deleted?
	
	Can someone enlighten me.
Thanks
Kiran

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: Memory growth in DOM

Posted by Gareth Reakes <ga...@decisionsoft.com>.
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: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org