MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / freeMemory

Method freeMemory

ij/src/main/java/ij/IJ.java:1006–1016  ·  view source on GitHub ↗

Returns a string something like "64K of 256MB (25%)" that shows how much of the available memory is in use. This is the string displayed when the user clicks in the status bar.

()

Source from the content-addressed store, hash-verified

1004 * status bar.
1005 */
1006 public static String freeMemory() {
1007 long inUse = currentMemory();
1008 String inUseStr = inUse<10000*1024?inUse/1024L+"K":inUse/1048576L+"MB";
1009 String maxStr="";
1010 long max = maxMemory();
1011 if (max>0L) {
1012 double percent = inUse*100/max;
1013 maxStr = " of "+max/1048576L+"MB ("+(percent<1.0?"<1":d2s(percent,0)) + "%)";
1014 }
1015 return inUseStr + maxStr;
1016 }
1017
1018 /** Returns the amount of memory currently being used by ImageJ. */
1019 public static long currentMemory() {

Callers 9

mousePressedMethod · 0.95
getInfoMethod · 0.95
getVariablesMethod · 0.95
doIJMethod · 0.95
runMethod · 0.95
runMethod · 0.95
createStackMethod · 0.95
currentMemoryMethod · 0.80

Calls 3

currentMemoryMethod · 0.95
maxMemoryMethod · 0.95
d2sMethod · 0.95

Tested by 1