Java examples for Java Virtual Machine:Utility
Get Maximum Memory Available to Java Virtual Machine(JVM)
public class Main { public static void main(String args[]){ Runtime runtime = Runtime.getRuntime(); long maxMemory = runtime.maxMemory(); System.out.println(maxMemory + " bytes max"); } /*w w w . jav a 2 s . c o m*/ }