Out of memory: Have to restart matlab

2 次查看(过去 30 天)
susan
susan 2012-6-22
Hello,
Is there something besides 'pack ' and 'clear' to avoid having to restart matlab when working with large files (~500 MB) on a 4GB memory (Macbook Air) laptop?
Thanks, S
  2 个评论
Walter Roberson
Walter Roberson 2012-6-22
Note: If you use large arrays in MS Windows, then memory fragmentation will eventually require you to restart to get an array of maximum size.
I do not know the situation for OS-X.
I have never encountered this kind of situation on MATLAB for 64 bit Linux.
Ryan G
Ryan G 2012-6-22
In windows there is the memory shield option
http://www.mathworks.com/help/techdoc/ref/matlabwindows.html
(search shieldoption)
Unfortunately I was not able to find a mac equivalent but this might help you find something.

请先登录,再进行评论。

回答(2 个)

Ken Atwell
Ken Atwell 2012-6-25
Are you using a new-ish version of (64-bit) MATLAB on your Mac, or and older 32-bit version? I ask because 64-bit addressing should go a very long way to avoiding out-of-memory errors due to fragmentation.
Can you tell us what version of MATLAB you are using, and be more specific about the problems you are encountering that force you to restart MATLAB?
  3 个评论
Ken Atwell
Ken Atwell 2012-6-25
Thanks for the clarification. R2007b was a 32-bit release, and fragmentation over time is inevitable. If you have the means to migrate to newer 64-bit version (10b and later are only available in 64-bit form), I believe you will have a much better experience.
If you must remain on 32-bit MATLAB, Ryan's suggestions are probably the best you can do.
Walter Roberson
Walter Roberson 2012-6-25
The MacBook Air with 4Gb was not released until 2011. The supported operating systems for that generation of MacBook Air are Lion and Mountain Lion. R2007b is, however, not supported on either of those: the earliest version supported on Lion is R2009a.
The hardware and software combination being used is thus not supported.
http://en.wikipedia.org/wiki/MacBook_Air#Specifications
http://support.apple.com/kb/HT1159

请先登录,再进行评论。


Ryan G
Ryan G 2012-6-22
You can try utilizing
clear all; clear mex; clear functions;
to dig a little deeper while clearing but my guess is this would still eventually lead you OOM with no out.

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by