MATLAB Programming Fundamentals - MathWorks

(やまだぃちぅ) #1

Resolve “Out of Memory” Errors


In this section...
“General Suggestions for Reclaiming Memory” on page 29-9
“Increase System Swap Space” on page 29-10
“Set the Process Limit on Linux Systems” on page 29-10
“Disable Java VM on Linux Systems” on page 29-10
“Free System Resources on Windows Systems” on page 29-11

General Suggestions for Reclaiming Memory


The MATLAB software is a 64-bit application that runs on 64-bit operating systems. It
generates an Out of Memory message whenever it requests a segment of memory from
the operating system that is larger than what is available. When you see the Out of
Memory message, use any of the techniques discussed under “Strategies for Efficient Use
of Memory” on page 29-2 to help optimize the available memory including:


  • Reducing required memory

  • Selecting appropriate data storage

  • Using contiguous memory

  • Reclaiming used memory


If the Out of Memory message still appears, you can try any of the following:


  • If possible, reduce the size of your data. For example, break large matrices into
    several smaller matrices so that less memory is used at any one time.

  • If you have large files and data sets, see “Large Files and Big Data”.

  • Make sure that there are no external constraints on the memory accessible to
    MATLAB. On Linux® systems, use the limit command to investigate.

  • Increase the size of the swap file. We recommend that you configure your system with
    twice as much swap space as you have RAM. For more information, see “Increase
    System Swap Space” on page 29-10.

  • Add more memory to the system.


Resolve “Out of Memory” Errors
Free download pdf