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: Sat, 6 Oct 2012 05:27:10 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 12
Message-ID: <k4offe$kgv$1@newscl01ah.mathworks.com>
References: <k41182$90l$1@newscl01ah.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: www-05-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1349501230 21023 172.30.248.37 (6 Oct 2012 05:27:10 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 6 Oct 2012 05:27:10 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2264149
Xref: news.mathworks.com comp.soft-sys.matlab:779996

Yeah, I encountered a similar thing (on Windows) but never needed to solve it in the end.  I guess that by using "who" you could replicate a similar functionality, e.g.,

% Create some variables
x = ones(1000);
y = zeros(1000);
memory

% Clear them
V = who;    % <-- this can take regexps as arguments
s = sprint('[%s] = deal([])', sprintf('%s ', X{:}));
eval(s);
memory