Here you can find the source of allocatedMemory()
public static long allocatedMemory()
//package com.java2s; //License from project: Apache License public class Main { /**/*w w w . ja v a 2 s . c o m*/ * @return the total amount of memory currently available for current * and future objects, measured in bytes. */ public static long allocatedMemory() { return Runtime.getRuntime().totalMemory(); } }