Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 34

Thread: Collada DOM memory leak issue.

  1. #11
    Junior Member
    Join Date
    Apr 2006
    Posts
    27
    I propose a patch. First of all modify the cleanup() function :

    Code :
    void
    DAE::cleanup()
    {
    	if (DAEInstanceCount == 0) {
    		daeElement::releaseElements();
    		daeMetaElement::releaseMetas();
    		daeAtomicType::uninitializeKnownTypes();
    	}
    }

    And add the new function to the daeElement class :

    Code :
    void daeElement::releaseElements()
    {
    	resolveArray.clear();
    }

    which is declared static.

    It is simple but it works for me.

  2. #12
    Junior Member
    Join Date
    Nov 2007
    Posts
    10
    Hi,

    I am getting memory leaks too !!
    DAE:cleanup() had no effect !!
    Was there any solution for this ????

  3. #13
    Senior Member
    Join Date
    Jan 2006
    Location
    Foster City, CA
    Posts
    540
    Most of the leaks were cleaned up a long time ago. I just ran valgrind on the DOM test program from the latest code in the Subversion repo on SourceForge. It reported one (smallish) memory leak in the .raw file test, which I fixed in revision 320. Now valgrind reports no memory leaks in the automated tests.

    What leaks are you getting? What version of the DOM are you using?

    Steve

  4. #14
    Junior Member
    Join Date
    Nov 2007
    Posts
    10
    I use,

    * COLLADA 1.4.1 DOM 1.2
    * COLLADA schema version: 1.4.1 and 1.3.1

    Here is my setup if it helps,

    My collada stuff resides in a dll (with multithreaded debug dll code generation flag)
    The collada object is instantiated and destroyed within a global function scope (copies data from collada format to my format and destroys it)

    the dll is used (imported) in a static lib project which is compiled with multithreaded debug flag

    this static lib is then used in the .exe project which is compiled with multithreaded debug flag. It is here i use the crt dump memory leaks function. I made sure that the dumping takes place after all destructors are called (atleast the exe part of it). I am not sure when the destructors of the dll are called, but I checked the breakpoint placed at the destruction of collada object got hit.

    ---------
    One more thing I just noticed...
    When I first made the collada dll, for some reason (please explain this as well) my collada dll gave a warning
    LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library

    I ignored this and ran the application, but I got a pop-up window saying,
    "Runtime error !
    R6034
    An application has made an attempt to load the C runtime library incorrectly "

    When I use /NODEFAULTLIB flag, I get a ton load of error messages all related to unresolved external symbol from libcollada_dom_d.lib, libxml2 and others.

    So, finally I got it working by not using /NODEFAULTLIB and by setting ignore library flag to MSVCRT.

    I somehow assume by ignoring MSVCRT, the dumping of memory leaks is taking place. Please help !!!!

  5. #15
    Senior Member
    Join Date
    Jan 2006
    Location
    Foster City, CA
    Posts
    540
    DOM 1.2 is from Nov 06, so it's pretty old. I believe that most of the memory leaks were cleaned up in DOM 1.3 (from March 07), and that the leaks are completely gone from the latest version of the code in Subversion.

  6. #16
    Senior Member
    Join Date
    Jan 2006
    Location
    Foster City, CA
    Posts
    540
    I somehow assume by ignoring MSVCRT, the dumping of memory leaks is taking place. Please help !!!!
    I don't think that's the case. I'm pretty sure we use that same ignore command in some of our apps. I think the issue is mixing debug and release versions of the C runtime, and that the ignore command clears it up.

  7. #17
    Junior Member
    Join Date
    Nov 2007
    Posts
    10
    I have used the following installer
    COLLADA_DOM_FX_RT_1.3.0_VC8.exe

    But looks like the readme file inside it says
    "
    * COLLADA 1.4.1 DOM 1.2
    * COLLADA schema version: 1.4.1 and 1.3.1
    "

    So I am quite unsure what "latest version" means ??

  8. #18
    Senior Member
    Join Date
    Jan 2006
    Location
    Foster City, CA
    Posts
    540
    It's a misprint in the readme.

  9. #19
    Junior Member
    Join Date
    Sep 2005
    Posts
    6
    i am getting a leak with code as simple as:

    DAE* pCollada = new DAE;
    delete pCollada;
    DAE::cleanup();

    this is with the latest code from SVN, build as a static lib.

  10. #20
    Senior Member
    Join Date
    Jan 2006
    Location
    Foster City, CA
    Posts
    540
    Where specifically is the DOM leaking? What platform are you running on? What leak-detection tool are you using?

    Also, just fyi, you don't need to call DAE::cleanup yourself. It's called automatically when the last DAE is destroyed.

    Thanks,
    Steve

Page 2 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
  •