Fwd: Almost no memory leaks.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Fwd: Almost no memory leaks.

James Crook


Kudos to Paul for completing his work on new/delete in the most recent
commits.

Typical use of Audacity under the debugger now completes without any
memory leaks.  The exception is Nyquist effects/generators, as Nyquist
does doesn't tidy up its mallocs on closing - but everything else I
tried does.

--James.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Fwd: Almost no memory leaks.

Paul Licameli
Thanks, James.

"No naked news!"  Now let's keep it that way.  It is now easy to find all occurrences of "new" in the program, which are mostly inside strings, and review them.

I proposed changes to Roger to clean up the not-really memory leaks when Nyquist shuts down, and I think he took them upstream, so we would get that too with updated Nyquist libraries.

It's still possible to leak memory even with conscientious use of smart pointers.  One possible way is with a cycle of std::shared_ptr but I don't think that exists anywhere.

Another more serious possibility is that some long persisting object keeps pointers to memory longer than it needs.  For instance, for each Effect there is a singleton object.  Keeping things in member variables of the Effect, when they aren't needed outside of one effect computation, is a memory leak of sorts, though not in the strict sense because there is eventual reclamation when the program exits.

Even so, it is good to know that smart pointers are now used wherever there is an allocation, or at least, so it is outside of lib-src.

PRL


On Sun, Mar 19, 2017 at 5:59 PM, James Crook <[hidden email]> wrote:


Kudos to Paul for completing his work on new/delete in the most recent
commits.

Typical use of Audacity under the debugger now completes without any
memory leaks.  The exception is Nyquist effects/generators, as Nyquist
does doesn't tidy up its mallocs on closing - but everything else I
tried does.

--James.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Loading...