Here you can find the source of totalMemory()
public static long totalMemory()
//package com.java2s; //License from project: LGPL public class Main { public static long totalMemory() { return Runtime.getRuntime().totalMemory(); }//from www . ja v a2 s . c om }