|
-
June 6th, 2008, 02:02 AM
#1
XQuery
Hello everyone,
I am writing XQuery based on an XML file. I am using instance type of XPathDocument, XPathNavigator, XPathExpression and XPathNodeIterator.
My question is does any of them need to be released to free resource? I have not found any Close/Dispose methods for them. It is so strange to me since at least the XML file to be queried needs to be closed.
thanks in advance,
George
-
June 6th, 2008, 03:17 AM
#2
Re: XQuery
Geroge, if you want to know why Microsoft didnt implement XPathNavigator.Dispose, write to Microsoft.
I'd probably hate reading your code, given that you seem to obsess about resource disposal I reckon a good percentage of it would be doing away with variables that are going to be disposed of in a few nanoseconds anyway (thanks to scope)
Go do some work, and stop worrying about everything; if you want to micromanage memory usage, use C++
-
June 6th, 2008, 03:33 AM
#3
Re: XQuery
Hi cjard,
I am using Perfmon to monitor the Handle Count of my C# application process, and it continues to grow. I do not know what happened, so I investigating each part of code which needs resource release.
 Originally Posted by cjard
Geroge, if you want to know why Microsoft didnt implement XPathNavigator.Dispose, write to Microsoft.
I'd probably hate reading your code, given that you seem to obsess about resource disposal I reckon a good percentage of it would be doing away with variables that are going to be disposed of in a few nanoseconds anyway (thanks to scope)
Go do some work, and stop worrying about everything; if you want to micromanage memory usage, use C++
regards,
George
-
June 6th, 2008, 04:24 AM
#4
Re: XQuery
I dont know for certain, but the figure youre looking at might be misleading because it might include references that havent been garbage collected yet. Dont worry about big numbers too much; they dont always indicate a problem that needs fixing immediately
-
June 6th, 2008, 04:38 AM
#5
Re: XQuery
Thanks cjard,
From your help, I think there is no need to release any resource mentioned in my original post, looks like all types I mentioned has no need to release resource. Correct? :-)
 Originally Posted by cjard
I dont know for certain, but the figure youre looking at might be misleading because it might include references that havent been garbage collected yet. Dont worry about big numbers too much; they dont always indicate a problem that needs fixing immediately
regards,
George
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|