File Exchange

image thumbnail

MEM displays memory usage to the command window.

version 1.1.0.0 (1.4 KB) by Brenden Epps
MEM displays memory usage to the command window.

0 Downloads

Updated 11 Jun 2012

View Version History

View License

MEM displays memory usage to the command window.

As many programmers have experienced, Matlab grinds to a near standstill when large amounts of memory are used in the workspace. MEM gives a succinct report of the memory used, so the programmer can see which variables are using the most memory (and thus causing the slow-down).

This function is only useful for programmers who develop codes containing hundreds of variables, in which case they might not remember the size of each variable off the top of their head. MEM helps the programmer determine how best to streamline the memory usage and improve the speed of his or her code.

Cite As

Brenden Epps (2020). MEM displays memory usage to the command window. (https://www.mathworks.com/matlabcentral/fileexchange/37074-mem-displays-memory-usage-to-the-command-window), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (4)

Jan

@Brenden: Please explain the inputs and outputs in the description on this page. Currently the results of this function can be understand by downloading and running the function only. But I want to estimate if this function is useful *before* I download it.
It is essential if the memory is stored in contiguos blocks or in separate chunks. E.g. a large DOUBLE matrix has completely other effects than a large CELL vector, which contains all columns of the same matrix. On one hand there is an overhead of about 100 byte per cell element, on the other hand it is more difficult to reserve large contiguos memory blocks.
However, this function can be useful for debugging in the case of memory problems. A "feature memstats" would be helpful also.

Brenden Epps

As many programmers have experienced, Matlab grinds to a near standstill when large amounts of memory are used in the workspace. MEM gives a succinct report of the memory used, so the programmer can see which variables are using the most memory (and thus causing the slow-down).

This function is only useful for programmers who develop codes containing hundreds of variables, in which case they might not remember the size of each variable off the top of their head. MEM helps the programmer determine how best to streamline the memory usage and improve the speed of his or her code.

Jan

@Pasco: It would be helpful for Brendon and other users if you take the time to explain, why you think that this submission is useless.

Pasco Alquim

Please, spare us from this useless thing

MATLAB Release Compatibility
Created with R2010a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!