How to clear the memory occupied by matlab??
445 views (last 30 days)
Show older comments
Bless on 6 Feb 2013
Commented: Eric Bodenchak on 30 Apr 2022
I'm working in matlab GUI and it occupies more memory and cause out-of-memory error. Even if I clear all the variables by clearvars, the memory remains
Maximum possible array: 11 MB (1.112e+007 bytes) *
Memory available for all arrays: 267 MB (2.799e+008 bytes) **
Memory used by MATLAB: 1477 MB (1.548e+009 bytes)
Physical Memory (RAM): 2766 MB (2.900e+009 bytes)
Could anyone help me how to flush out the memory used by MATLAB???
Jan on 6 Feb 2013
Edited: Jan on 6 Feb 2013
But when diskswapping was used intensively even restarting Matlab can leave the operating system in a state of a reduced responsiveness. Then use the most powerful FEX: WinPower:
WinPower('RebootMatlab', 'disp(''Hello again'')');
This restarts the computer...
See also: FEX: Java heap cleaner
More Answers (2)
Sean de Wolski on 6 Feb 2013
See the memory management tips linked from the bottom of:
Christian Schwermer on 16 Aug 2020
MATLAB doesn't release memory, if you didn't declare the variable as output for the function.
Find more on Performance and Memory in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!