public static String memoryToString() { DecimalFormat fmt = new DecimalFormat("0.0"); return "Memory: " + fmt.format(RUNTIME.maxMemory() / 1048576D) + "MByte maximum, " + fmt.format(RUNTIME.totalMemory() / 1048576D) + "MByte total, " + fmt.format(RUNTIME.totalMemory() / 1048576D) + "MByte free"; }
public String toString() { String result = "f=" + (runtime.freeMemory() / MEGA) + "/"; result += "t=" + (runtime.totalMemory() / MEGA) + "/"; result += "m=" + (runtime.maxMemory() / MEGA) + "Mb"; return result; }