octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #55287] Memory leak in graphics subsystem


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #55287] Memory leak in graphics subsystem
Date: Wed, 9 Jan 2019 09:31:32 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0

Follow-up Comment #33, bug #55287 (project octave):

I think it is a leak, but the objects are still recorded by Octave and cleaned
up at exit.

It looks to me like successive calls to "plot" don't delete the children of
previous plots.  That's what clf does when called with no arguments.  In that
case, "do_reset" will be false and we'll end up executing the code following
the else:


    ## Select only the chilren with visible handles.
    kids = get (hfig, "children");
    delete (kids);

    ## Also delete the annotation axes
    hover = findall (hfig, "-depth", 1, "tag", "scribeoverlay");
    delete (hover);


If I use this modified version of the example in comment #26, I don't see a
leak:


i=0;
do
 i += 1;
 data = rand (100_000, 1);
 delete (gca);
 plot (data);
 drawnow;
until (i > 1e4)


Simply deleting gca might not be sufficient, as the figure may have other
children that are also not cleaned up properly.

So, where should we be cleaning up previous plots?  In the newplot function? 
In the C++ code that manages figures?  I'm not sure, but it should probably be
fairly deep in the plotting code so that we properly clean up all types of
figures, not just those generated by "plot".




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?55287>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]