23.06.2015 Views

MATLAB Programming

MATLAB Programming

MATLAB Programming

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Resolving “Out of Memory” Errors<br />

Resolving “Out of Memory” Errors<br />

<strong>MATLAB</strong> generates an Out of Memory message whenever it requests a<br />

segment of memory from the operating system that is larger than what<br />

is currently available. This section covers the following topics providing<br />

suggestions on how to resolve such errors:<br />

• “General Suggestions for Reclaiming Memory” on page 11-21<br />

• “Compressing Data in Memory” on page 11-22<br />

• “Increasing System Swap Space” on page 11-22<br />

• “Freeing Up System Resources on Windows Systems” on page 11-23<br />

• “Reloading Variables on UNIX Systems” on page 11-23<br />

General Suggestions for Reclaiming Memory<br />

When you see the Out of Memory message, use any of the techniques discussed<br />

under “Using Memory Efficiently” on page 11-12 to help optimize the available<br />

memory. If the Out of Memory message still appears, you can try any of the<br />

following:<br />

• Compress data to reduce memory fragmentation<br />

• If possible, break large matrices into several smaller matrices so that less<br />

memory is used at any one time.<br />

• If possible, reduce the size of your data.<br />

• Make sure that there are no external constraints on the memory accessible<br />

to <strong>MATLAB</strong>. (On UNIX systems, use the limit command to check).<br />

• Increase the size of the swap file. We recommend that your machine<br />

be configured with twice as much swap space as you have RAM. See<br />

“Increasing System Swap Space” on page 11-22, below.<br />

• Add more memory to the system.<br />

On machines running Windows 2000 Advanced Server or Windows 2000<br />

Datacenter Server, the amount of virtual memory space reserved by the<br />

operating system can be reduced by using the /3GB switch in the boot.ini<br />

file. More documentation on this option can be found at the following URL:<br />

11-21

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!