Total Memory Java Virtual Machine (JVM) Example
Chapter:
Run Time
Last Updated:
17-06-2016 08:39:42 UTC
Program:
/* ............... START ............... */
public class JavaJVMTotalMemory {
public static void main(String args[]) {
Runtime runtime = Runtime.getRuntime();
long totalMemory = runtime.totalMemory();
System.out.println(totalMemory + " bytes total in JVM");
}
}
/* ............... END ............... */
Output
64487424 bytes total in JVM
Tags
Total Memory Java Virtual Machine (JVM), Java, Runtime