Here you can find the source of getMemoryUtiliztaion()
public static String getMemoryUtiliztaion()
//package com.java2s; import java.text.DecimalFormat; public class Main { private static DecimalFormat df = new DecimalFormat("#,###"); public static String getMemoryUtiliztaion() { Runtime runtime = Runtime.getRuntime(); return "heap=" + df.format(runtime.totalMemory()) + " max=" + df.format(runtime.maxMemory()) + " used=" + df.format(runtime.totalMemory() - runtime.freeMemory()) + " free=" + df.format(runtime.freeMemory()); }/* ww w .j a v a2 s .com*/ }