Wednesday, May 13, 2009

Set /3GB Startup Switch for MATLAB Memory Performance

The May 8 entry of the MATLAB blog File Exchange Pick of the Week offers information on a user submitted function CHKMEM.M that can provide good information about the status of your computer's memory. I downloaded the file and run it and among other things it notified me that

3GB switch status:
The MATLAB process limit has been detected as 2047MB, therefore the 3GB switch in your system's boot.ini file is NOT SET. If you add this switch you can gain an additional 1GB of memory space for MATLAB.

Good catch! I forgot to set that when I set up my new PC.

The /3GB switch is set in the Boot.ini file and it increases the amount of virtual memory from 2 GB to 3 GB which will help with some MATLAB 'out of memory' errors.

Detailed instructions on how to set are available from Microsoft in article How to Set the /3GB Startup Switch in Windows.

For Windows XP my initial Boot.ini file read:

[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect

and was changed to:

[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect /3GB

After PC restart and rerun of CHKMEM.M the message changed to:

3GB switch status:
The MATLAB process limit has been detected as is 3071MB, therefore the 3GB switch in your system's boot.ini is SET.

The memory available on my R2008b MATLAB increased from 1491 MB to 2572 MB (can check by running the MEMORY function at the command prompt).

matlabCmdWindow_

No comments:

Post a Comment