This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Memory Usage

Identify and reduce memory requirements

MATLAB® handles data storage for you automatically. However, in high memory usage applications, it can be beneficial to determine the memory usage of your code. You can learn techniques to write code that uses memory more efficiently.


memory Display memory information
inmem Names of functions, MEX-files, classes in memory
pack Consolidate workspace memory


How MATLAB Allocates Memory

MATLAB handles data storage automatically. However, understanding how MATLAB allocates memory can help you use memory more efficiently when writing code.

Strategies for Efficient Use of Memory

Reduce the amount of memory your program requires, determine the appropriate data storage, avoid fragmenting memory, and reclaim used memory.

Resolve "Out of Memory" Errors

MATLAB generates an Out of Memory message whenever it requests a segment of memory from the operating system that is larger than what is available.

Was this topic helpful?