uCosminexus Application Server, API Reference Guide

[Contents][Index][Back][Next]

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 name Function
getEdenFreeMemory Method Acquires the available space in the Eden area.
getEdenMaxMemory Method Acquires the maximum space used by the Eden area.
getEdenTotalMemory Method Acquires the available space in the Eden area.
getPermFreeMemory Method Acquires the available space in the Permanent area.
getPermMaxMemory Method Acquires the maximum space used by the Permanent area.
getPermTotalMemory Method Acquires the available space in the Permanent area.
getSurvivorFreeMemory Method Acquires the available space in the Survivor area.
getSurvivorMaxMemory Method Acquires the maximum space used by the Survivor area.
getSurvivorTotalMemory Method Acquires the available space in the Survivor area.
getTenuredFreeMemory Method Acquires the available space in the Tenured area.
getTenuredMaxMemory Method Acquires the maximum space used by the Tenured area.
getTenuredTotalMemory Method Acquires 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