Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 34

Thread: Collada DOM memory leak issue.

  1. #21
    Junior Member
    Join Date
    Sep 2005
    Posts
    6
    thanks for the prompt reply!

    i am using .net 2005. the leak is 24 bytes as reported by CRT debug info.

    i will try to add the source into my solution so i can trace it and let you know what exactly is leaking.

  2. #22
    Senior Member
    Join Date
    Jan 2006
    Location
    Foster City, CA
    Posts
    540
    I'm using this as my test program:
    Code :
    #include <dae.h>
     
    int main() {
    	DAE* dae = new DAE;
    	delete dae;
    	DAE::cleanup();
    	return 0;
    }
    (Again, the DAE::cleanup isn't necessary, but I wanted to be consistent with what you were doing). Neither Valgrind nor VS 2005 report any memory leaks for me with this code, in either debug or release mode. I'm a bit stumped about how to reproduce this... you're sure you're not using old libs or anything? And that the memory leak is coming from the DOM?
    i am using .net 2005. the leak is 24 bytes as reported by CRT debug info.
    Just to make sure, you don't need to turn on anything special to get leaks reported in VS, right? Just running the program under the debugger should report leaks?

    Steve

  3. #23
    Junior Member
    Join Date
    Sep 2005
    Posts
    6
    I include these in my main.cpp

    // header files for debuging memory leak:
    #define _CRTDBG_MAP_ALLOC
    #include <stdlib.h>
    #include <crtdbg.h>


    then put these lines in your main():

    // enable memory leak check
    _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF | _CRTDBG_CHECK_EVERY_1024_DF);

    these should give you leaks...

  4. #24
    Senior Member
    Join Date
    Jan 2006
    Location
    Foster City, CA
    Posts
    540
    Thanks, I get the leak report now. Unfortunately the report doesn't say anything about where the leak comes from, even though I know I have debug symbols setup properly because I can step into the DOM in the debugger. I'm not sure how to track this down, but I'll keep thinking about it. If you have any ideas be sure to let me know.

  5. #25
    Junior Member
    Join Date
    Nov 2007
    Posts
    10
    Just an FYI, the CRT dump memory leaks will report STL global variables , global class objects that have instantiation and destruction(I think) as memory leaks.

  6. #26
    Junior Member
    Join Date
    Sep 2005
    Posts
    6
    Quote Originally Posted by sthomas
    Thanks, I get the leak report now. Unfortunately the report doesn't say anything about where the leak comes from, even though I know I have debug symbols setup properly because I can step into the DOM in the debugger. I'm not sure how to track this down, but I'll keep thinking about it. If you have any ideas be sure to let me know.
    there are a lot of leaks once you load a file with a DAE object too. maybe there are better tools under Linux for you to track them down?

  7. #27
    Senior Member
    Join Date
    Jan 2006
    Location
    Foster City, CA
    Posts
    540
    Quote Originally Posted by mkandula
    Just an FYI, the CRT dump memory leaks will report STL global variables , global class objects that have instantiation and destruction(I think) as memory leaks.
    Thanks for the info. The leak report could be bogus I guess, or from something other than the DOM (like the STL, which the DOM uses).
    Quote Originally Posted by endseeker2
    there are a lot of leaks once you load a file with a DAE object too.
    I don't get any additional leaks when I load a file. I get the same 24-byte leak report. I'm using a debug build of VS 2005, linking against the DOM statically. Let me know if there's anything else I need to do to see the additional leaks.
    Quote Originally Posted by endseeker2
    maybe there are better tools under Linux for you to track them down?
    That's the interesting thing: valgrind doesn't report any leaks. The only thing I can think to try is using a different memory leak detector on the Windows build.

  8. #28
    Junior Member
    Join Date
    Sep 2005
    Posts
    6
    this leak detector might help?
    http://dmoulding.googlepages.com/downloads

    i couldn't get it to work with vista, it should work if you use windows xp.

  9. #29
    Senior Member
    Join Date
    Jan 2006
    Location
    Foster City, CA
    Posts
    540
    Thanks for the tip. I'll try it out tomorrow.

  10. #30
    Senior Member
    Join Date
    Jan 2006
    Location
    Foster City, CA
    Posts
    540
    That leak detector worked pretty well. It gave me a call stack so I was able to track down the problem. There's a small leak in the libxml function __xmlGlobalInitMutexLock. A CRITICAL_SECTION object is allocated and never freed. I've reported the bug. In the meantime, I don't think this should be a show-stopper. It's a single 24-byte leak. It only occurs once in your app. If you have any other leaks you'd like me to look at, be sure to let me know. As I mentioned, I don't see any other leaks.

    Just for the record, both Microsoft's leak detector and valgrind were right: on Windows there's a 24-byte leak in libxml, but on Linux there is no libxml leak because different code is executed.

    Steve

Page 3 of 4 FirstFirst 1234 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •