Here you can find the source of getMemoryUsage()
public static String getMemoryUsage()
//package com.java2s; //License from project: Open Source License public class Main { private static final long MB = 1024 * 1024; public static String getMemoryUsage() { return ((Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / MB) + "/" + (Runtime.getRuntime().totalMemory() / MB) + "/" + (Runtime.getRuntime().maxMemory() / MB + " Mb"); }/*w w w .j av a 2 s. co m*/ }