Get Maximum Memory Available to Java Virtual Machine(JVM) - Java Java Virtual Machine

Java examples for Java Virtual Machine:Utility

Description

Get Maximum Memory Available to Java Virtual Machine(JVM)

Demo Code

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*/
}

Result


Related Tutorials