473,405 Members | 2,415 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

DOM memory disposal question

Lee
Hi there,

Not sure if this is the most relevent newsgroup so please redirect me if
needed.

I just have a general query regarding how memory disposal works in relation
to the DOM object model. Take a look at the pseudo code below.

Dim odom as domdocument
dim onode as node
dim onodeclone as node
dim onodes as nodelist

odom = createobject

onode = selectsinglenode("/blah")
onodes = selectnodes("//blah")
onodeclone = onode.clone

Now, its a given that the odom object needs to be set to nothing but what
else does, if anything? My understanding is the following: -

The onode object will just hold a memory reference to somewhere in the odom
memory space.

onodes will store an array/arraylist of these memory references

onodeclone will have its own memory and contain a replica of the data stored
in the memory location referenced by onode.

So saying that, which of the above would I have to dispose of too? Are
onode and onodes taken care of when you dispose of the odom object? I am
guessing you would have to dispose of onodeclone since it has its own memory?

Maybe there is a web resource which explains this in detail?

Thanks in advance.
Jan 13 '06 #1
1 1493
Lee wrote:
Hi there,

Not sure if this is the most relevent newsgroup so please redirect me
if needed.

I just have a general query regarding how memory disposal works in
relation to the DOM object model.
You mean the XMLDOM model?
Take a look at the pseudo code
below. <snip> Now, its a given that the odom object needs to be set to nothing but


Not really. The garbage collector will do it for you. Oh, sure, if you have
a large domdocument, and your page has other processing to do, it could be
beneficial to release it early, but if your page is finished processing,
there is no need to do anything else.

Now if you were talking about an ADO Recordset, I would have a different
answer: there have been memory leaks reported as a consequence of failing to
close and destroy recordsets prior to closing and destroying the connections
used to open them. This does not apply to xml domdocuments

http://blogs.msdn.com/ericlippert/ar...28/122259.aspx

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jan 13 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Justin Lazanowski | last post by:
Cross posting this question on the recommendation of an I have a .NET application that I am developing in C# I am loading information in from a dataset, and then pushing the dataset to a grid,...
16
by: Justin Lazanowski | last post by:
Cross posting this question on the recommendation of an I have a .NET application that I am developing in C# I am loading information in from a dataset, and then pushing the dataset to a grid,...
16
by: Justin Lazanowski | last post by:
Cross posting this question on the recommendation of an I have a .NET application that I am developing in C# I am loading information in from a dataset, and then pushing the dataset to a grid,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.