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