Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: clear all does not free the allocated memory in linux
Date: Fri, 5 Oct 2012 12:06:07 +0000 (UTC)
Organization: Kobenhavns Universitet
Lines: 23
Message-ID: <k4miff$69l$1@newscl01ah.mathworks.com>
References: <k41182$90l$1@newscl01ah.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: www-01-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1349438767 6453 172.30.248.46 (5 Oct 2012 12:06:07 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 5 Oct 2012 12:06:07 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2043520
Xref: news.mathworks.com comp.soft-sys.matlab:779936

"Reza Dadar" wrote in message <k41182$90l$1@newscl01ah.mathworks.com>...
> Hi all,
> This question is not new. I've seen it a lot. Mostly for the windows systems. But as far as I know it is still unsolved.
> you can find a similar discussion at
> http://www.mathworks.com/matlabcentral/newsreader/view_thread/240448
> 
> Here is the problem!
> I've been running a script requiring a large amount of memory in Matlab (2012b).
> In order to save RAM,  variables are cleared by a "clear all" command or "clear "variable name"" during my scripts.
> But this does not solve anything, since I can tell by the Linux System Monitor that memory is still taken by Matlab (which can exceed 12GB), even if I cleared all variables with a "clear all".
> 
>  Memory is only freed if I shut down Matlab and restart it.
> Is there any command that really clears all the cache?
> Thank you!

I have a similar problem that seems to be a LOT worse afgter I upgraded to Matlab 2012b:
Windows 7 pro, 32bit running on:
Intel Core 2 Duo CPU, 2.8GZ. 4GB RAM. 

Whenever vars are cleared using either clearall, clearvars, clear all hidden etc, the memory available for Matlab single arrays does not increase. 
And I run out of memory performing simple tasks. 

Any solutions would be appreciated?