List of utility methods to do Memory Available
long | availableMemory() Returns the amount of available memory (free memory plus never allocated memory). return RUNTIME.freeMemory() + RUNTIME.maxMemory() - RUNTIME.totalMemory();
|
long | availableMemory() Determine the amount of available memory. Runtime rt = Runtime.getRuntime();
return rt.maxMemory() - rt.totalMemory() + rt.freeMemory();
|
long | availableMemory() Returns the amount of available memory (free memory plus never allocated memory). return Runtime.getRuntime().freeMemory()
+ (Runtime.getRuntime().maxMemory() - Runtime.getRuntime().totalMemory());
|
float | availableMemoryPercent() Returns the amount of available memory in percents. return availableMemory() * 100.0f / Runtime.getRuntime().maxMemory();
|
long | getAvailableMemory() Gets the available memory. Runtime runtime = Runtime.getRuntime(); int max = (int) (runtime.maxMemory() / 1024 / 1024); int total = (int) (runtime.totalMemory() / 1024 / 1024); int free = (int) (runtime.freeMemory() / 1024 / 1024); free = free + max - total; int used = max - free; return free; |
long | getAvailableMemory() get Available Memory Runtime runtime = Runtime.getRuntime(); long maxMemory = runtime.maxMemory(); long allocatedMemory = runtime.totalMemory(); long freeMemory = runtime.freeMemory(); return freeMemory + (maxMemory - allocatedMemory); |
long | getAvailableMemory() get Available Memory long freeMemory = Runtime.getRuntime().freeMemory(); return getMaximumMemory() - freeMemory; |
long | getAvailableMemory() TODO TEST!! Runtime rt = Runtime.getRuntime(); long maxMem = rt.maxMemory(); long freeMem = rt.freeMemory(); long totalMem = rt.totalMemory(); long used = totalMem - freeMem; long available = maxMem - used; return available; |
double | getAvailableMemoryFraction() get Available Memory Fraction Runtime runtime = Runtime.getRuntime(); long maxMemory = runtime.maxMemory(); long allocatedMemory = runtime.totalMemory(); long freeMemory = runtime.freeMemory(); return (double) ((freeMemory + (maxMemory - allocatedMemory))) / maxMemory; |
long | getAvailableMemorySize() Get available memory size long maxMemorySize = 512 * 1024 * 1024; if (Runtime.getRuntime().maxMemory() > maxMemorySize) { maxMemorySize = Runtime.getRuntime().maxMemory(); long freeMemorySize = Runtime.getRuntime().freeMemory(); long totalMemorySize = Runtime.getRuntime().totalMemory(); long usedMemorySize = totalMemorySize - freeMemorySize; return maxMemorySize - usedMemorySize; ... |