File Exchange

image thumbnail

Largest memory block available (All platforms)

version 1.0.0.1 (2.19 KB) by

Find the largest contiguous memory block available for array allocation on all platforms.

0 Downloads

Updated

View License

>> largestmemblock
Maximum contiguous block is approximately:
 (Accurate to 95% of real memory value)
             833019 KB
                813 MB

% More accurate value
>> largestmemblock([],0.9999)

Maximum contiguous block is approximately:
 (Accurate to 95% of real memory value)
             835717 KB
                816 MB

Comments and Ratings (1)

Keith

Keith (view profile)

On my machine, allocating these huge matrices within the largestmemblock function takes ~15 seconds, where it is practically instant in the workspace. If you replace:

     A = zeros(round(B), 1, 'uint8');

with:
    evalin('base',sprintf('XMEMBLOCKLARGEX = zeros(%i,1,''uint8''); clear XMEMBLOCKLARGEX;',round(B)));

it runs much, much faster.

Updates

1.0.0.1

Updated license

MATLAB Release
MATLAB 7.9 (R2009b)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video