Java program to get the details about memory
Hi everyone, in this post, I am writing about how to get the details of maximum memory, free memory, total memory and used memory in java. maxMemory() - Specifies the maximum amount of memory java virtual machine will attempt to use. maxMemory is returned in bytes totalMemory() - Specifies the total amount of memory in java virtual machine. The totalMemory will vary according to the host environment. totalMemory is returned in bytes. freeMemory() - Specifies the amount of free memory in jvm. freeMemory is returned in bytes. The information about all these memory types are provided by Runtime class of java. The memory used by jvm can be obtained from different methods of the Runtime class. Following java program specifies a clear idea about getting details about 3 types of memories. package com.techjourney; /** * Created with IntelliJ IDEA. * User: Sujith * Date: 6/19/13 * Time: 11:1...