MSXML PARSER 4.0 problem
-
- 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)?
-
- 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)?
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
-
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 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.
-
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.
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?
-
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?
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)?