CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: XQuery

  1. #1
    George2 is offline Elite Member Power Poster
    Join Date
    Oct 2002
    Posts
    4,468

    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

  2. #2
    Join Date
    Oct 2003
    Location
    .NET2.0 / VS2005 Developer
    Posts
    7,104

    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++
    "it's a fax from your dog, Mr Dansworth. It looks like your cat" - Gary Larson...DW1: Data Walkthroughs 1.1...DW2: Data Walkthroughs 2.0...DDS: The DataSet Designer Surface...ANO: ADO.NET2 Orientation...DAN: Deeper ADO.NET...DNU...PQ

  3. #3
    George2 is offline Elite Member Power Poster
    Join Date
    Oct 2002
    Posts
    4,468

    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.

    Quote 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

  4. #4
    Join Date
    Oct 2003
    Location
    .NET2.0 / VS2005 Developer
    Posts
    7,104

    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
    "it's a fax from your dog, Mr Dansworth. It looks like your cat" - Gary Larson...DW1: Data Walkthroughs 1.1...DW2: Data Walkthroughs 2.0...DDS: The DataSet Designer Surface...ANO: ADO.NET2 Orientation...DAN: Deeper ADO.NET...DNU...PQ

  5. #5
    George2 is offline Elite Member Power Poster
    Join Date
    Oct 2002
    Posts
    4,468

    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? :-)

    Quote 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
  •  





Click Here to Expand Forum to Full Width

Featured