Linux frozen by assigning complex value to preallocated matrix
Show older comments
Hello, I have a question about matrix pre-allocation of complex data. When I run the following script on my CentOS5 x86_64 PC with 64G of RAM, no swap, it becomes unresponsive after using up all its memory. All I can do is to hard power-off or wait until OOM killer is invoked. The data are lost either way. This may be due to the virtual memory handling by Linux, but I wonder why Matlab couldn't detect it. When I asked the Mathworks customer service, they said it was a normal feature and intended behavior. Does anybody know how to efficiently avoid data loss? Simple error trapping by out of memory is enough for me....
----------------------------------------------
%HangTest.m
A = zeros(1024,1204,1024,5);
whos
A(end,end,end,end) = 1i;
whos
for n = 1:size(A,4)
A(:,:,:,n) = 1;
end
----------------------------------------------
>> HangTest
Name Size Bytes Class Attributes
A 4-D 50499420160 double
Name Size Bytes Class Attributes
A 4-D 100998840320 double complex
and unresponsive after this.
Thanks,
Masao
Accepted Answer
More Answers (0)
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!