Q:-Write a program in Java. To find out memory statistics available for Java Virtual Machine.
Code
Source Code import java.io.*; class Memory { public static void main(String[] args) { System.out.println("Total Memory for JVM(Java Virtul Machine ) " + "\t\t\t"+Runtime.getRuntime().totalMemory()); System.out.println("The maximum Memory that JVM(Java Virtual Machine) can use is\t"+Runtime.getRuntime().maxMemory()); System.out.println("The amount of free memory in Java Virtual Machine is: \t\t"+Runtime.getRuntime().freeMemory()); } }
No comments:
Post a Comment