Possible computer hang from rigorous matlab calculation?

4 views (last 30 days)
Forgive the ignorant question, I'm still somewhat new to Matlab, but help would be greatly appreciated:
I am doing spectral analysis on datasets of 500,000-1.5 million data points using the Chronux toolbox. I'm running 64-bit matlab 2011b with 8 GB ram and an I7 processor. I have recently run a few rather rigorous analysis where my computer hangs for several hours (hard-drive LED stays lit and sounds like it is running, mouse experiences choppy movement, no other programs including task manager respond, ctrl c does not stop the script). My question is: 1) is it possible for matlab to hijack all the memory causing these types of problems? 2)if so, how to limit the amount of memory available to matlab so it cannot cause this type of crash? I am not so concerned with whether the data runs or not (if it is simply too much data), I just want to establish a safeguard so this type of memory take-over could not happen and lock up my computer, especially if I were need to hard-reset while the HD is working. Thanks for any response.

Answers (3)

Jan
Jan on 12 Oct 2011
The is no secure protection against a stuffed memory. And it is very easy to exhaust the memory by forgetting a pre-allocation or a small typo:
x = [];
for x = 1:1e7
x(i) = rand; % Brrrrrrrrrrr
end
y = rand(1e7); % Brrrrrrrrrrr, this is rand(1e7, 1e7)
So I'd kill the Matlab session and start to debug.

Walter Roberson
Walter Roberson on 12 Oct 2011

awinde05
awinde05 on 12 Oct 2011
Thank you for taking the time to respond, both answers are informative, but to clarify a bit more: when such a hang-up happens on my system, I cannot just kill matlab as is suggested in both posts. It seizes my entire system so closing windows, ctrl-alt-delete, changing windows etc. are non-responsive or unbelievably slow. Could Matlab be capable of taking over my system so thoroughly? or is there a limit on how much of my memory is available for calculation? Thank you again for the time spent on these responses.
  2 Comments
Walter Roberson
Walter Roberson on 12 Oct 2011
Actually my answer didn't suggest killing MATLAB: I suggested setting process limits, and gave the Linux & Mac-OS X methods of doing that.
I have been looking around a bit, and so far the answers I have seen are that there is no way to set per-process memory limits in Vista :(
Walter Roberson
Walter Roberson on 12 Oct 2011
Note to myself: http://blogs.technet.com/b/markrussinovich/archive/2009/07/08/3261309.aspx

Sign in to comment.

Tags

Community Treasure Hunt

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

Start Hunting!