MATLAB: How to view only the largest contiguous free memory block using system_dep​endent(‘du​mpmem’) in MATLAB 7.1 (R14SP3) on Windows

blockscontiguousfilefreelargestMATLABmemorypagephysicalramspaceswapvirtual

Using system_dependent('dumpmem') on Windows, MATLAB allows me to view my memory allocation status. It would be convenient to be able to suppress all outputs from system_dependent('dumpmem') except for the size of the largest contiguous free memory block.

Best Answer

The ability to view only the largest contiguous free memory block using system_dependent('dumpmem') is not available in MATLAB 7.1 (R14SP3) on Windows.
Enter the following in the Command Window to isolate this information:
largestFreeBlock = system_dependent('memstats')
In order to assign the value to a variable while suppressing the output of MEMSTATS in the Command Window, you can do the following:
evalc('largestBlock_MB = system_dependent(''memstats'') / 1024 / 1024');
Starting with MATLAB 7.6 (R2008a), you can use the function MEMORY in order to access memory information.