How to improve memory administration inside Matlab?
Show older comments
How do I have to re-initialize my Matlab R2013b session in order to free the memory and to reestablish the contiguous virtual address space as I found them after a fresh start of Matlab? I would like to obtain this by a script within my Matlab session. I do not want to quit MATLAB and use any automatic procedure to restart Matlab completely and asking it to continue automatically with works.
This is my present situation, freshly having started a new Matlab session: Maximum possible array: 732 MB (7.680e+08 bytes)
After doing some works with Matlab, just before getting produced an ‘out-of-memory’ error: Maximum possible array: 254 MB (2.664e+08 bytes)
I here tried to free the memory to my best knowledge not even knowing if any ‘mex’ functionality was in use, or if the figure configuration might produce any real impact:
clear all;
clear mex;
clear functions;
clf;
close;
Maximum possible array: 372 MB (3.896e+08 bytes)
Only restarting the Matlab session completely advances the situation completely, I receive again: Maximum possible array: 732 MB (7.680e+08 bytes)
I already expect from reading about ‘out-of-memory’ discussions, that my 32-bit Win XP OS should be claimed responsible, but: why can´t Matlab at startup just reserve (i.e. occupy) all the available memory (i.e. the total of 1.7 GB which is offered to it on my system upon opening the session, including the i.e. 732 MB block of contiguous virtual address space), and then administrate this memory itself? Am I missing how to force Matlab to do this (I am almost raw beginner to Matlab, so far only know in this context to start my session as ‘matlab –shield medium’, and the ‘clear’ and ‘close’ commands exactly as listed above, and the ‘pack’ command which to the beginning or end of that list didn´t affect things), or is Matlab itself not prepared for any further memory administration?
If not changing to 32-bit Linux or changing to a 64-bit PC with 64-bit MS Win, would you have any suggestions what else I could do inside Matlab itself to improve memory re-establishement, besides applying my presented “list of re-initialization commands”?
Accepted Answer
More Answers (0)
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!