thanks<br><br>i used stacksize("min") and it freed the memory<br><br><br><br><div class="gmail_quote">On Sun, Jun 19, 2011 at 1:08 PM, Jonathan Blanchard <span dir="ltr"><<a href="mailto:BlanchardJ@ieee.org">BlanchardJ@ieee.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div></div><div class="h5">On Sun, Jun 19, 2011 at 1:53 PM, Process Control<br>
<<a href="mailto:computerprocesscontrol@gmail.com">computerprocesscontrol@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
> I ran the follwing commands:<br>
><br>
> stacksize("max")<br>
> tic();rand(10000,10000);toc()<br>
><br>
> It works fine and the stacksize after running these commands is:<br>
><br>
> 2.684D+08    8179<br>
><br>
> But in the process monitor on gnome, scilab-bin is occupying 1.6 GiB. So,<br>
> the only way to free this RAM is to restart scilab. Please, could you<br>
> explain what is going on and how to free the memory without restarting<br>
> scilab.<br>
><br>
> thank you<br>
><br>
<br>
</div></div>Well, by calling stacksize("max") Scilab will try to increase it's<br>
stack to the maximum possible which it did in this case. The memory<br>
usage displayed by gnome monitor is the process virtual memory usage<br>
which will never shrink even if the memory is freed. The amount of<br>
physical memory used is the resident set size but I'm not sure how to<br>
check that on a Linux system. To free physical memory after it's not<br>
needed you can reduce the Scilab stack with the same command, however<br>
it cannot be reduced smaller than what is currently necessary to store<br>
all the active variables in Scilab. The clear() command can be used to<br>
remove unwanted variables and then the stack size can be reduced.<br>
<font color="#888888"><br>
Jonathan Blanchard<br>
</font></blockquote></div><br>