10.5 MemoryInfo Class

Description
You can acquire the memory information of garbage collection directly from a Java program.
For example, the space that is being currently used is calculated with the following expression:

getXXXTotalMemory()-getXXXFreeMemory()

The package of the MemoryInfo class is JP.co.Hitachi.soft.jvm.
List of methods
Method nameFunction
getEdenFreeMemory MethodAcquires the available space in the Eden area.
getEdenMaxMemory MethodAcquires the maximum space used by the Eden area.
getEdenTotalMemory MethodAcquires the available space in the Eden area.
getPermFreeMemory MethodAcquires the available space in the Permanent area.
getPermMaxMemory MethodAcquires the maximum space used by the Permanent area.
getPermTotalMemory MethodAcquires the available space in the Permanent area.
getSurvivorFreeMemory MethodAcquires the available space in the Survivor area.
getSurvivorMaxMemory MethodAcquires the maximum space used by the Survivor area.
getSurvivorTotalMemory MethodAcquires the available space in the Survivor area.
getTenuredFreeMemory MethodAcquires the available space in the Tenured area.
getTenuredMaxMemory MethodAcquires the maximum space used by the Tenured area.
getTenuredTotalMemory MethodAcquires the available space in the Tenured area.
Usage example
The examples of method usage for acquiring memory information are as follows:
For obtaining the free size of Perm area

free_memory = JP.co.Hitachi.soft.jvm.MemoryInfo.getPermFreeMemory()

For obtaining the currently used Eden area

use_memory = JP.co.Hitachi.soft.jvm.MemoryInfo.getEdenTotalMemory()-JP.co.Hitachi.soft.jvm.MemoryInfo.getEdenFreeMemory()

Organization of this section
getEdenFreeMemory Method
getEdenMaxMemory Method
getEdenTotalMemory Method
getPermFreeMemory Method
getPermMaxMemory Method
getPermTotalMemory Method
getSurvivorFreeMemory Method
getSurvivorMaxMemory Method
getSurvivorTotalMemory Method
getTenuredFreeMemory Method
getTenuredMaxMemory Method
getTenuredTotalMemory Method