Here you can find the source of freeAllocatedMemory()
public static long freeAllocatedMemory()
//package com.java2s; public class Main { /**//from w w w. ja va2s . c o m * Returns the amount of free memory in the Java Virtual Machine. Calling * the {@link Runtime#gc()} method may result in increasing the value * returned by freeMemory. * * @return an approximation to the total amount of memory currently * available for future allocated objects, measured in bytes. */ public static long freeAllocatedMemory() { return Runtime.getRuntime().freeMemory(); } }