Code ran fine previously but now says 'out of memory'
1 view (last 30 days)
Show older comments
Hi all, I 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 (albeit now space on C drive is super low, can that have an impact?). ran fine 2 months ago. the license did change to a different university - can that have an effect??
its running fine 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 similar to previously used 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 Comments
Accepted Answer
Walter Roberson
on 13 Sep 2023
There is one possibility:
If you have configured Preferences -> MATLAB -> Workspace -> MATLAB array size limit
to be off, then the amount of memory that MATLAB would use would be limited by the amount of swap space that your system will provide. On Windows, the amount of swap space possible depends upon how much space is available on the C: drive (unless configured otherwise).
So, Yes, under limited conditions, having low space on C can affect how much memory MATLAB can access.
5 Comments
Walter Roberson
on 16 Sep 2023
I have somes reclaimed a lot of space in Windows by removing old versions of windows; see https://support.microsoft.com/en-us/windows/delete-your-previous-version-of-windows-f8b26680-e083-c710-b757-7567d69dbb74
The old versions of windows are stored in a protected directory so you cannot remove them just using Windows Explorer.
Dyuman Joshi
on 16 Sep 2023
(Going slightly off the topic)
They are stored so that one can restore back to the older version, mostly in the case of incompatibility e.g. if it makes the system slower, or if it causes a BSOD error. Though I was under the understanding that they were deleted after a month, maybe for newer updates it is 10 days.
The Windows Update for a good amount of time now have been extremely sluggish, and with each update completed in my PC, MATLAB takes more time to start. Sigh.
More Answers (0)
See Also
Categories
Find more on Parallel Computing Fundamentals in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!