List of utility methods to do Memory Free
boolean | isFreeMemoryAvailable() is Free Memory Available Runtime runtime = Runtime.getRuntime(); long maxMemory = runtime.maxMemory(); long totalFree = runtime.freeMemory() + maxMemory - runtime.totalMemory(); return totalFree > maxMemory * 0.2; |
String | jvmFreeMemory(String size, Boolean txtByte) Obtain JVM's Free Memory. return convertByteSize(Runtime.getRuntime().freeMemory(), size, txtByte);
|
long | memoryFree() memory Free long mem = 0; for (int i = 0; i < 10; i++) mem += runtime.freeMemory(); mem /= 10; return mem; |
int | memoryFree() memory Free Runtime runtime = Runtime.getRuntime();
return Math.round(runtime.freeMemory() / 1024f);
|
double | sampleFreeMemory() Get current free memory The current memory is saved for Memory usage analysis startMemory = Runtime.getRuntime().freeMemory();
return ConvertByteToMegaByte(startMemory);
|