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

Thread: Memory leak?

  1. #1
    Join Date
    Mar 2003
    Posts
    62

    Exclamation Memory leak?

    Hi, i'm trying to load an xml document from C++ with:




    MSXML::IXMLDOMDocumentPtr pXMLDocument (__uuidof (MSXML:OMDocument)); // main document parsed

    hr = pXMLDocument->loadXML (BSTRTemp); /* trying parse string, if success, we have doc object*/


    this method uses offensive memory. i have xml files that are about 100MB size.

    i feel the function does not clear the memory. anyone an idea?
    if i load 3 times the same file, my memory is full.


    suggestion? is there a free method or something?


    thank you,


    lutz


  2. #2
    Join Date
    Mar 2003
    Posts
    62

    Re: Memory leak?

    Can noone help me?


  3. #3
    Join Date
    Aug 2004
    Location
    Land of sunshine and June Gloom
    Posts
    171

    Re: Memory leak?

    If you use Visual Studio .net there is a nice XMLDocument class with much nicer syntax that avoids any pointers, COM junk, and memory leaks.

  4. #4
    Join Date
    Mar 2003
    Posts
    62

    Re: Memory leak?

    unfortunately i have to use msdev 6.0...

  5. #5
    Join Date
    Aug 2004
    Location
    Land of sunshine and June Gloom
    Posts
    171

    Re: Memory leak?

    Since it's a ugly COM object I think you'll need to do

    pXMLDocument->Release();

    each time you are done with the document.

  6. #6
    Join Date
    Dec 1999
    Posts
    90

    Re: Memory leak?

    sorry to re-energize this old chain.But i am gettign heaps load of memry leak in loadxml.Did you get teh solution to your question?

  7. #7
    Join Date
    Mar 2003
    Posts
    62

    Re: Memory leak?

    Yes, use newer version of msxml.dll.

    Or, if you have a larger document, use a sax parser...


  8. #8
    Join Date
    May 2005
    Location
    Oregon
    Posts
    3,725

    Re: Memory leak?

    so you are using Dom Parser.that's good Just Go with This Link this will Help you
    http://www.codeguru.com/forum/showth...&highlight=XML

    if still any problem Please let us Know
    Thanx

  9. #9
    Join Date
    Mar 2003
    Posts
    62

    Re: Memory leak?

    Why should this link help him...i see nothing of interest for his question ?!?

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