Java tutorial
public class Main { public static void main(String[] argv) { long heapSize = Runtime.getRuntime().totalMemory(); System.out.println(heapSize); } }