I am currently processing data files that are so large that I can fit them to memory only one per at a time. My problem is that if I use structures for storing the data, I keep getting out of memory errors. I managed reproduce the problem with the following code:
clear;
mult = 200;
a = zeros(mult * 1000, 1000);
clear a;
for i = 1:mult
s(i).sa = rand(1000, 1000);
end
s_copy = s;
I was wondering if anyone can reproduce this problem or is my computer broken? You might need to adjust the 'mult' to a larger value to get the code reserve enough memory to cause the problem.
1 Comment
Klaus Förger (view profile)
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/224390-do-matlab-structures-leak-memory#comment_293158
Sign in to comment.