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);whosA(end,end,end,end) = 1i;whosfor n = 1:size(A,4) A(:,:,:,n) = 1;end---------------------------------------------->> HangTestName Size Bytes Class AttributesA 4-D 50499420160 doubleName Size Bytes Class AttributesA 4-D 100998840320 double complex
and unresponsive after this.
Thanks,
Masao
Best Answer