List of utility methods to do Memory Used
long | usedMemory(Runtime runtime) used Memory return runtime.totalMemory() - runtime.freeMemory();
|
String | usedMemoryAsString() used Memory As String long avaiableMemory = usedMemory(); double d = avaiableMemory / 1048576; return d + "MB"; |
int | usedMemorym() used Memorym return (int) Math.floor((usedMemoryb() / megabytes)); |
double | usedMemoryMB() Get used memory in megabytes return megaBytes(Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory());
|
double | usedMemoryPercents() Returns percents of used memory. Runtime runtime = Runtime.getRuntime(); long totalMemory = runtime.totalMemory(); return (double) (totalMemory - runtime.freeMemory()) / totalMemory * 100.0; |
double | usedMemoryRatio() used Memory Ratio return (double) usedMemory() / (double) maxMemory(); |
void | useMemoryLimitOver() use Memory Limit Over memoryLimitOver = true; |