Here you can find the source of getAllocatedMemory()
public static long getAllocatedMemory()
//package com.java2s; //License from project: Open Source License public class Main { public static long getAllocatedMemory() { return Runtime.getRuntime().totalMemory(); }/*from w w w. j a v a2 s. com*/ }