Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. XML / XSL
  4. MSXML PARSER 4.0 problem

MSXML PARSER 4.0 problem

Scheduled Pinned Locked Moved XML / XSL
xmlperformancehelpquestion
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    impeham
    wrote on last edited by
    #1

    - IXMLDOMDocument2Ptr ObjXMLDoc; - hresult = ObjXMLDoc.CreateInstance("Msxml2.DOMDocument.4.0"); i then perform the following call: - ObjXMLDoc->load(Filename); where Filename is a valid XML file (no scheme is used). this call takes out memory resources, and when i use the same last call with a different Filename, it takes more of it - without releasing the last one's resources. is there a way to "Unload" an xml file from memory (to perform something like the opposite of "load" method)?

    L 1 Reply Last reply
    0
    • I impeham

      - IXMLDOMDocument2Ptr ObjXMLDoc; - hresult = ObjXMLDoc.CreateInstance("Msxml2.DOMDocument.4.0"); i then perform the following call: - ObjXMLDoc->load(Filename); where Filename is a valid XML file (no scheme is used). this call takes out memory resources, and when i use the same last call with a different Filename, it takes more of it - without releasing the last one's resources. is there a way to "Unload" an xml file from memory (to perform something like the opposite of "load" method)?

      L Offline
      L Offline
      LordEsined
      wrote on last edited by
      #2

      To my knowledge, the only way to free the memory used is to release the object containing the held memory. Try the .Release method on the smart pointer to free the pointer, but not the reference. Because *Ptr's are smart pointers (_com_ptr_t), don't get this method mixed up with the ->Release method. If that does not work, try a master/worker approach with one main reference on the object and subsequent QIs on it for "worker" references. HTH, Ryan

      I 1 Reply Last reply
      0
      • L LordEsined

        To my knowledge, the only way to free the memory used is to release the object containing the held memory. Try the .Release method on the smart pointer to free the pointer, but not the reference. Because *Ptr's are smart pointers (_com_ptr_t), don't get this method mixed up with the ->Release method. If that does not work, try a master/worker approach with one main reference on the object and subsequent QIs on it for "worker" references. HTH, Ryan

        I Offline
        I Offline
        impeham
        wrote on last edited by
        #3

        i tried to free the memory using .Release method - it did release it, but the memory is still not released. i tried working with only one reference to the object, but it still used more resources on every call to the .load method. i also tried using ::CoFreeUnusedLibraries(); ::CoUninitialize(); at the end of the function which does all that. still - the memory is not released.

        L 1 Reply Last reply
        0
        • I impeham

          i tried to free the memory using .Release method - it did release it, but the memory is still not released. i tried working with only one reference to the object, but it still used more resources on every call to the .load method. i also tried using ::CoFreeUnusedLibraries(); ::CoUninitialize(); at the end of the function which does all that. still - the memory is not released.

          L Offline
          L Offline
          LordEsined
          wrote on last edited by
          #4

          The only other thing I can think of it that you are probably running in Debug mode. Debug mode has lots of extra features to help protect running code (Buffering around data structures, holding references, etc). Do you see the problem running in Release mode?

          I 1 Reply Last reply
          0
          • L LordEsined

            The only other thing I can think of it that you are probably running in Debug mode. Debug mode has lots of extra features to help protect running code (Buffering around data structures, holding references, etc). Do you see the problem running in Release mode?

            I Offline
            I Offline
            impeham
            wrote on last edited by
            #5

            it's not the debug mode. i was trying to perform .Release() on the XML IXMLDOMDocument2Ptr object at different places in the code - in order to search for the place that keeps the resources unreleased after that method call. i found that the method released the resources, until i used a function call, to my own function which one of its parameters is from type IXMLDOMNodePtr. i could see that a new reference to the object was added, but i wasn't able to release the resources after this function all, even by using "= NULL" on the object in this function plus the original one that was sent. am i not releasing the object as i should? can't i send a smart pointer as a parameter to my own function and get rid of the object afterwards (not the object - it's cought resources - the object itself becomes NULL)?

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups