Here you can find the source of maxMemory()
public static long maxMemory()
//package com.java2s; public class Main { static Runtime runtime = Runtime.getRuntime(); public static long maxMemory() { return runtime.maxMemory(); }//from w w w .ja va 2 s. co m }