- The code changed
- the input values or the values produced by a random process changed
- There are additional background processes or global variables being stored that weren't a problem previously
- Something in your startup.m file (if you have one) is affecting memory.
- Perhaps the first time you ran it, the code correctly ended before reaching memory capacity.
- Maybe, just maybe, the first time you ran it you missed the error message.
Memory error when code ran fine before
1 次查看(过去 30 天)
显示 更早的评论
I'm running a code (using R2016a, Windows 10) which requires several large matrices to exist simultaneously (4 3744×256×159 matrices). I've cleared as much of the unrequired variables as possible. What is unusual is that I ran this code overnight for about 10 loops a few days ago and it worked fine. Now when I run it it won't go past the first iteration without giving an out of memory error. I have closed matlab, restarted the computer and restarted matlab in between but have not added anything to the computer or opened any other programmes which would take up RAM compared to the previous successful run. This would suggest that matlab is holding on to some data from the previous run but I don't know how to overcome this.
Any advice would be much appreciated
1 个评论
Adam Danz
2020-5-29
Do you have a startup.m file and if so, is it doing something that would affect memory?
Small correction to your question; any values with >2 dimensions are called arrays. Matrices are only 2D.
There are lots of possible explanations.
回答(2 个)
Manas Meena
2021-2-10
You can try changing the TMP file to a different folder. But as Adam suggested there can be several possible explanations to this issue.
0 个评论
Aditi
2023-9-12
Hi, I have the same problem.
Have used a code for years and ran it on thousands of datasets (3D medical images, size 512x512x100). now for some reason, MATLAB says out of memory at a specific point in the code when nothing has changed in the code or the type of input file/variable and its the same computer. ran fine 2 months ago. the license did change to a different university - can that have an effect??
its running on smaller sized variables (124x124x100) but I've run it on much larger files many times before, no problem. rest all input variables are the same and its a very optimized code written and published and used by several groups. what could the issue possibly be? I've tried looking everywhere
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!