<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Hi Tim,<br>
      <br>
      Same memory drift with Scilab 5.5.2 and 6.0-a2 on win7_x64 is
      observed.<br>
      plot2d() is clearly involved, since further tests show that<br>
      <pre style="font-family:Monospaced;font-style:normal;font-size:14.0;"><span style="color:rgb(0,0,0);">r</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(50,185,185);">rand</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(188,143,143);">1</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(188,143,143);">5000</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">n</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(0,0,0);">;</span> 
<span style="color:rgb(160,32,240);">for</span> <span style="color:rgb(0,0,0);">n</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(188,143,143);">1</span><span style="color:rgb(255,170,0);">:</span><span style="color:rgb(188,143,143);">10000</span><span style="color:rgb(0,0,0);">;</span> 
    <span style="color:rgb(174,92,176);">clf</span><span style="color:rgb(0,0,0);">;</span> 
    <span style="color:rgb(50,185,185);">plot2d</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(0,0,0);">r</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(188,143,143);">1</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(255,170,0);">:</span><span style="color:rgb(74,85,219);">)</span> <span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(0,0,0);">r</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(188,143,143);">1</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(255,170,0);">:</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(0,0,0);">;</span> 
<span style="color:rgb(160,32,240);">end</span></pre>
      already leaks, and apparently faster than when encapsulated in
      graphalot(), while<br>
      <pre style="font-family:Monospaced;font-style:normal;font-size:14.0;"><span style="color:rgb(0,0,0);">r</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(50,185,185);">rand</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(188,143,143);">1</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(188,143,143);">5000</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">n</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(0,0,0);">;</span> 
<span style="color:rgb(160,32,240);">for</span> <span style="color:rgb(0,0,0);">n</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(188,143,143);">1</span><span style="color:rgb(255,170,0);">:</span><span style="color:rgb(188,143,143);">10000</span><span style="color:rgb(0,0,0);">;</span> 
    <span style="color:rgb(174,92,176);">clf</span><span style="color:rgb(0,0,0);">;</span> 
<span style="color:rgb(160,32,240);">end
<font color="#000000">
does not.</font>
<font color="#000000">Hope this will help debugging.
Memory linkage of plot2d() is not yet reported on bugzilla.

Regards
Samuel Gougeon
</font></span>
</pre>
      Le 21/12/2015 06:37, Tim Wescott a écrit :<br>
    </div>
    <blockquote cite="mid:1450676247.2707.6.camel@Servo" type="cite">
      <pre wrap="">I'm running scilab-5.5.0 on Ubuntu 14.04.

When I run the attached script and then run "graphalot" for a while,
Scilab's memory usage climbs monotonically.  What is actually getting
plotted doesn't seem to make a difference -- I just did the particular
plots seen there because it's fun.

I'm seeing this in a rather large, rather graphics-intensive script I'm
using.  If I let the thing go unattended too long then Scilab slows to a
crawl and takes my computer with it -- I suspect that if I were willing
to wait for geologically significant amounts of time I could stop
Scilab, but I usually end up just cringing and whining, then resetting
the computer.

(I'm not sure what would happen in Windows, or if there's a better way,
under Linux, to make it not drag the rest of the world down.  I just try
not to let the problem happen in the first place).

I searched the bugbase for it, but my ability to find good search terms
is usually far better in hindsight than actual use.  So -- is this a
known bug, or should I file a bug report?

If it's known, has it been fixed?  In what version?

Here's the script, in case file attachment doesn't work on the list:

function graphalot()
    for n = 1:10000; 
        bob = rand(1, 5000, "n"); 
        r = flts(bob, [%z^2 - 1; 0.5 * %z] / (%z^2 - 1.95*%z + 0.999)); 
        scf(0); 
        drawlater(); 
        clf; 
        plot2d(r'); 
        ssz = stacksize(); 
        xtitle(sprintf("iteration #%d, stack used %d", n, ssz(2))); 
        drawnow(); 
        scf(1); 
        clf; 
        drawlater(); 
        plot2d(r(1, :), r(2, :), frameflag = 3, rect = [-150, -150, 150,
150]); 
        drawnow(); 
    end
endfunction

</pre>
    </blockquote>
    <br>
  </body>
</html>