|Programming and Data Types|
Making Efficient Use of Memory
This section discusses how to conserve memory and improve memory use. Topics include
For more information on memory management, see Technical Note 1106: "Memory Management Guide", at the following URL:
Memory Management Functions
The following functions can help you to manage memory use in MATLAB:
whosshows how much memory has been allocated for variables in the workspace.
packsaves existing variables to disk, and then reloads them contiguously. This reduces the chances of running into problems due to memory fragmentation.
clearremoves variables from memory. One way to increase the amount of available memory is to periodically
clearvariables from memory that you no longer need.
saveselectively stores variables to the disk. This is a useful technique when you are working with large amounts of data. Save data to the disk periodically, and then
clearthe saved data from memory.
loadreloads a data file saved with the
quitexits MATLAB and returns all allocated memory to the system. This can be useful on UNIX systems as UNIX does not free up memory allocated to an application (e.g., MATLAB) until the application exits.
|Viewing profile Results||Ways to Conserve Memory|