MATLAB: How to clear up some memory

MATLABmemoryram

When I run computationally-intensive scripts, memory usage goes up and my computer slows down a little bit. This is to be expected. But sometimes after running one of these scripts I close all and clear all, yet when I check my system Activity Monitor Matlab is still using 3.5 GB and my computer runs slow until I restart Matlab. Any tricks for clearing up memory without restarting Matlab? I'm running Matlab R2012b on OSX 10.8.5.

Best Answer

UNIX systems do not return memory allocated to an application until the application exits. So it's not really a Matlab problem.