Page 1 of 3 123 LastLast
Results 1 to 10 of 25

Thread: Memory Leaks

  1. #1
    Junior Member
    Join Date
    Apr 2006
    Posts
    27

    Memory Leaks

    I tried to get the last version (1.4.1) of the DOM but I get tons of memory leaks ! I already had several ones on the previous versions but I made a patch to get rid of them. It's not enough on the last version.

    https://collada.org/public_forum/vie...df374d94c#1270

    Do you have the same problems ?

  2. #2
    Senior Member
    Join Date
    Jan 2006
    Location
    Foster City, CA
    Posts
    540
    Yeah I was getting a ton of memory leaks any time I did anything with the dom. See this bug I posted over at SourceForge.

    Here's a zip file that has all the files I changed to eliminate the memory leaks. If you search for "sthomas" in the files you'll find the code I changed. Some of the fixes I wasn't 100% sure about, so be careful.

    My changes are based on the latest code in the svn repository, which has changed since the official 1.4.1 release. If you're going to use my fixes you should first grab the latest code from the repository.

    Also, my code incorporates your fix for a previous memory leak that's described in the thread you linked to.

  3. #3
    Junior Member
    Join Date
    Apr 2006
    Posts
    27
    Thanks a lot !

    I don't understand why these bugs are opened for a so long time. I'll check your code soon.

  4. #4
    Senior Member
    Join Date
    Aug 2005
    Location
    California
    Posts
    165
    yeah, I'm sorry.

    Its only me who works on and maintains the COLLADA DOM. And thats not the only thing I do here at work. So lots of bugs that aren't really easy to track down sometimes take a while before I even attempt to fix them.

    But when people like sthomas supply patches to fix them, that makes me happy I will get his patch rolled into the project as soon as I can.

    Thanks,
    -Andy

  5. #5
    Junior Member
    Join Date
    Apr 2006
    Posts
    27
    Well, I now have a problem with the getInput_array() function for a domTriangle element. It's not due to the patch but to the SVN version.

    shtomas, do you experience the same pb ?

  6. #6
    Senior Member
    Join Date
    Jan 2006
    Location
    Foster City, CA
    Posts
    540
    No, I use domTriangles::getInput_array and don't have any problems at all. What kind of problems are you having? I don't think that code's changed at all since the initial release of the dom, so I doubt the latest svn version broke that functionality.

  7. #7
    Senior Member
    Join Date
    Aug 2005
    Location
    California
    Posts
    165
    do you store the return value of getInput_array(). It returns a reference to a daeTArray. You may be copying the array. And there might be a bug there. I dunno I haven't seen problems with that before but it might be worth looking into.

    -Andy

  8. #8
    Junior Member
    Join Date
    Apr 2006
    Posts
    27
    That was it, when I just get the address of the array, it works well. The problem be in the copy constructor.

    Why doesn't the getInput_array() returns a reference like most of the other Collada functions ?

  9. #9
    Senior Member
    Join Date
    Aug 2005
    Location
    California
    Posts
    165
    it does.
    Code :
    /**
     * Gets the input element array.
     * @return Returns a reference to the array of input elements.
     */
    domInputLocalOffset_Array &getInput_array() { return elemInput_array; }
    /**
     * Gets the input element array.
     * @return Returns a constant reference to the array of input elements.
     */
    const domInputLocalOffset_Array &getInput_array() const { return elemInput_array; }

    I'll look into the copy constructor and try to see why it is broken now.
    If you can file a bug on the SF project page with some more info that would be helpful.

    -Andy

  10. #10
    Junior Member
    Join Date
    Apr 2006
    Posts
    27
    I'll fill it as soon as I can.

    I'm experiencing new problems. No more memory leaks are detected but if I export a file and just after import it, I get an access violation. It seems that some pieces of static information are not well reseted. If I don't do the export before the import I don't have this problem.

    I do DAE::cleanup() at the end of the export.

    I did not have this problem with the version 1.4 patch 3 with my memory leak patch.

Page 1 of 3 123 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
  •