public class Main { public static void main(String[] argv) { long heapMaxSize = Runtime.getRuntime().maxMemory(); System.out.println(heapMaxSize); } }