Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
717 views
in Technique[技术] by (71.8m points)

matlab "memory" function on mac?

On Windows machines, MATLAB users can use either the memory or the feature memstats commands. However, neither of these work on a machine, failing as follows:

>> memory
??? Error using ==> memory
Function MEMORY is not available on this platform.

>> feature memstats
??? Error using ==> feature
An unknown feature was specified

Does anyone know of a way to access information about in-matlab memory usage on a Mac?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I have not been able to find a command that reproduces the functionality of memory. However, if you know how much total memory your system has, you can use who (or vsize from the file exchange for more detail) to estimate how much memory your variables are currently using and thus how much free space you have.

By the way, you can always find out about Java memory by calling

java.lang.Runtime.getRuntime.maxMemory
java.lang.Runtime.getRuntime.totalMemory
java.lang.Runtime.getRuntime.freeMemory

Note that Matlab memory and Java memory are different - Java memory is used for UI, including figures, as well as other java objects, while memory reports the memory available for variables and calculations.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...