(weird) Out Of Memory Error
1 回表示 (過去 30 日間)
古いコメントを表示
Dear all, I'm experiencing a weird out of memory error that can't really understand.
I have a few big 3D matrices A,B,X and a 3D vector N. I use A,B and N to fill X (one row at a time) doing something like: (X is preallocated to all zeroes)
X(i,:,k)= (A(i,:,k).*B(i,:,k))/N(i,1,k);
This causes some OUT OF MEMORY error, which might be fine.
What bothers me is that, when debugging, if I try to assign the right end to a NEW variable "p" then there is no problem.
That is if I write:
p = (A(i,:,k).*B(i,:,k))/N(i,1,k);
p is created and the values are assigned correctly.
However if I try to assign p to the row of X then the same issue appears:
X(i,:,k)=p; % this causes an OUT OF MEMORY ERROR
Now, this doesn't make sense to me. In theory the memory for X has already been allocated. Why the creation of a new (additional) vector doesn't cause an OUT OF MEMORY ERROR, while the assignment of a vector into an already existing Matrix causes does?
What can I do to overcome this? Before trying the assignment, only 20% of my memory is used by MATLAB (according to TOP), so I guess that should be more than enough.
I'have already increased the available memory for Matlab and followed (I think correctly) the advices provided in the MATLAB help. I'd like to find a fast "quick and dirty" solution to overcome this issue, that else would require rewriting a significant portion of code.
Thanks a lot for your help, Cheers, Luca
0 件のコメント
回答 (1 件)
Jason Ross
2012 年 8 月 30 日
For quick and dirty, I'd set the memoryuse / vmemoryuse to "unlimited" and see what happens.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Graphics Object Programming についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!