Here you can find the source of getMemoryMax()
public static long getMemoryMax()
//package com.java2s; /*//from ww w . java2 s . c o m * Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (http://h2database.com/html/license.html). * Initial Developer: H2 Group */ public class Main { /** * Get the maximum memory in KB. * * @return the maximum memory */ public static long getMemoryMax() { long max = Runtime.getRuntime().maxMemory(); return max / 1024; } }