Hi Kiran,
perhaps we are using different terminology here and confusing each
other. I will attempt to explain my understanding.
i) Things like element and attribute names are stored in a memory block
and are acquired by calling getPooledString. These are strings managed by
the document and will only be deleted when the document is. The same
technique is used when you call getValue on an attribute. Also, if that
string already exists in the pool, a new one is not created (i.e. if two
attributes have the same name, their names will share the same string in
the string pool.)
ii) DOMAttrImpl and DOMElementImpl (as well as the other node types) are
also stored in memory managed by the document. When you call one of the
factory methods, such as createElement, the document uses 'placement new'
to allocate the memory. Consider element creation: If someone has released
an element before we call create, then our new element will reuse this
memory as opposed to using a block of memory that has not previously been
used, or even creating a new block if we have run out of space.
iii) The document manages some memory that is newed by the creation and
use of nodes (such as DOMAttrMapImpl in the constructor of
DOMElementImpl). However, in the same way as the names of attributes and
elements, calling release on the element will not delete these things --
only releasing the document will do this. This is why you will see memory
increasing by simply creating and deleting elements of the same name.
There is also an issue with releasing elements that contain attributes:
The attibutes do not currently get released and there is no way to do so
after the release of the element (though it will be released with the
release of the document - see Bug[13197]).
I hope this makes it clearer! If not please point out where as I intend
to archive this message because I feel that it will be asked again!
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]