MATLAB does not throw OutOfMemoryExceptions or maximum size errors

In a previous version of MATLAB (7.6), I used OutOfMemoryErrors, which I thought was pretty annoying. But since I upgraded to 7.11, for some reason it no longer throws errors.

This means that when I accidentally try to make a variable too large, the MATLAB shell will try to create the variable and stop my machine.

I would really like these errors to be thrown, so that I can exit gracefully or debug my code, but I cannot find a solution anywhere.

Perhaps useful information: I use OSX 10.5 on a 64-bit machine with 4 GB of RAM.

In MATLAB 7.6:

$ rand(50000); ??? Error using ==> rand Maximum variable size allowed by the program is exceeded. 

In MATLAB 7.11:

 $ rand(50000); (hang) 
+7
source share
2 answers

Between versions 7.6 and 7.11, the Macintosh version of MATLAB switched from a 32-bit application to a 64-bit application. So now instead of running out of address space, MATLAB thrashes.

+2
source

Matlab is not freezing. This is just a paging that takes forever. Try to assign a large array, open the Activity Monitor and you will see that the "Virtual memory" is growing and growing.

If you reduce the page file size on your system, you can avoid this problem.

+1
source

All Articles