APIdia Launch Partner
Top Description Fields Constructors Methods
sun.management

pack-priv Class MemoryImpl

extends NotificationEmitterSupport
implements MemoryMXBean
Class Inheritance
All Implemented Interfaces
java.lang.management.MemoryMXBean, java.lang.management.PlatformManagedObject
Imports
java.lang.management.ManagementFactory, .MemoryMXBean, .MemoryUsage, .MemoryNotificationInfo, .MemoryManagerMXBean, .MemoryPoolMXBean, javax.management.ObjectName, .MBeanNotificationInfo, .Notification, javax.management.openmbean.CompositeData

Implementation class for the memory subsystem. Standard and committed hotspot-specific metrics if any. ManagementFactory.getMemoryMXBean() returns an instance of this class.

Field Summary

Modifier and TypeField and Description
private final VMManagement
private static MemoryManagerMXBean[]
private static final String[]
private static final String
private static final String[]
private static MemoryPoolMXBean[]
private static long

Constructor Summary

AccessConstructor and Description
pack-priv
MemoryImpl(VMManagement vm)

Constructor of MemoryImpl class

Method Summary

Modifier and TypeMethod and Description
pack-priv static void
createNotification(String notifType, String poolName, MemoryUsage usage, long count)

public void
gc()

Implements java.lang.management.MemoryMXBean.gc.

Runs the garbage collector.

public MemoryUsage
getHeapMemoryUsage()

Implements java.lang.management.MemoryMXBean.getHeapMemoryUsage.

Returns the current memory usage of the heap that is used for object allocation.

pack-priv static synchronized MemoryManagerMXBean[]
private static native MemoryManagerMXBean[]
pack-priv static synchronized MemoryPoolMXBean[]
private static native MemoryPoolMXBean[]
private native MemoryUsage
getMemoryUsage0(boolean heap)

private static long
public MemoryUsage
getNonHeapMemoryUsage()

Implements java.lang.management.MemoryMXBean.getNonHeapMemoryUsage.

Returns the current memory usage of non-heap memory that is used by the Java virtual machine.

public MBeanNotificationInfo[]
getNotificationInfo()

Implements abstract sun.management.NotificationEmitterSupport.getNotificationInfo.

Implements javax.management.NotificationBroadcaster.getNotificationInfo.

Returns an array indicating, for each notification this MBean may send, the name of the Java class of the notification and the notification type.

private static String
getNotifMsg(String notifType)

public ObjectName
getObjectName()

Implements java.lang.management.PlatformManagedObject.getObjectName.

Returns an ObjectName instance representing the object name of this platform managed object.

public int
getObjectPendingFinalizationCount()

Implements java.lang.management.MemoryMXBean.getObjectPendingFinalizationCount.

Returns the approximate number of objects for which finalization is pending.

public long
getTotalGcCpuTime()

Overrides default java.lang.management.MemoryMXBean.getTotalGcCpuTime.

Returns the approximate accumulated time, in nanoseconds, spent in garbage collection (GC).

public boolean
isVerbose()

Implements java.lang.management.MemoryMXBean.isVerbose.

Tests if verbose output for the memory system is enabled.

public void
setVerbose(boolean value)

Implements java.lang.management.MemoryMXBean.setVerbose.

Enables or disables verbose output for the memory system.

private native void
setVerboseGC(boolean value)

Inherited from sun.management.NotificationEmitterSupport:
addNotificationListenerhasListenersremoveNotificationListenerremoveNotificationListenersendNotification

Field Detail

jvmback to summary
private final VMManagement jvm
mgrsback to summary
private static MemoryManagerMXBean[] mgrs
notifMsgsback to summary
private static final String[] notifMsgs
notifNameback to summary
private static final String notifName
notifTypesback to summary
private static final String[] notifTypes
poolsback to summary
private static MemoryPoolMXBean[] pools
seqNumberback to summary
private static long seqNumber

Constructor Detail

MemoryImplback to summary
pack-priv MemoryImpl(VMManagement vm)

Constructor of MemoryImpl class

Method Detail

createNotificationback to summary
pack-priv static void createNotification(String notifType, String poolName, MemoryUsage usage, long count)
gcback to summary
public void gc()

Implements java.lang.management.MemoryMXBean.gc.

Doc from java.lang.management.MemoryMXBean.gc.

Runs the garbage collector. The call gc() is effectively equivalent to the call:

System.gc()
getHeapMemoryUsageback to summary
public MemoryUsage getHeapMemoryUsage()

Implements java.lang.management.MemoryMXBean.getHeapMemoryUsage.

Doc from java.lang.management.MemoryMXBean.getHeapMemoryUsage.

Returns the current memory usage of the heap that is used for object allocation. The heap consists of one or more memory pools. The used and committed size of the returned memory usage is the sum of those values of all heap memory pools whereas the init and max size of the returned memory usage represents the setting of the heap memory which may not be the sum of those of all heap memory pools.

The amount of used memory in the returned memory usage is the amount of memory occupied by both live objects and garbage objects that have not been collected, if any.

MBeanServer access:
The mapped type of MemoryUsage is CompositeData with attributes as specified in MemoryUsage.

getMemoryManagersback to summary
pack-priv static synchronized MemoryManagerMXBean[] getMemoryManagers()
getMemoryManagers0back to summary
private static native MemoryManagerMXBean[] getMemoryManagers0()
getMemoryPoolsback to summary
pack-priv static synchronized MemoryPoolMXBean[] getMemoryPools()
getMemoryPools0back to summary
private static native MemoryPoolMXBean[] getMemoryPools0()
getMemoryUsage0back to summary
private native MemoryUsage getMemoryUsage0(boolean heap)
getNextSeqNumberback to summary
private static long getNextSeqNumber()
getNonHeapMemoryUsageback to summary
public MemoryUsage getNonHeapMemoryUsage()

Implements java.lang.management.MemoryMXBean.getNonHeapMemoryUsage.

Doc from java.lang.management.MemoryMXBean.getNonHeapMemoryUsage.

Returns the current memory usage of non-heap memory that is used by the Java virtual machine. The non-heap memory consists of one or more memory pools. The used and committed size of the returned memory usage is the sum of those values of all non-heap memory pools whereas the init and max size of the returned memory usage represents the setting of the non-heap memory which may not be the sum of those of all non-heap memory pools.

MBeanServer access:
The mapped type of MemoryUsage is CompositeData with attributes as specified in MemoryUsage.

getNotificationInfoback to summary
public MBeanNotificationInfo[] getNotificationInfo()

Implements abstract sun.management.NotificationEmitterSupport.getNotificationInfo.

Implements javax.management.NotificationBroadcaster.getNotificationInfo.

Doc from javax.management.NotificationBroadcaster.getNotificationInfo.

Returns an array indicating, for each notification this MBean may send, the name of the Java class of the notification and the notification type.

It is not illegal for the MBean to send notifications not described in this array. However, some clients of the MBean server may depend on the array being complete for their correct functioning.

getNotifMsgback to summary
private static String getNotifMsg(String notifType)
getObjectNameback to summary
public ObjectName getObjectName()

Implements java.lang.management.PlatformManagedObject.getObjectName.

Doc from java.lang.management.PlatformManagedObject.getObjectName.

Returns an ObjectName instance representing the object name of this platform managed object.

getObjectPendingFinalizationCountback to summary
public int getObjectPendingFinalizationCount()

Implements java.lang.management.MemoryMXBean.getObjectPendingFinalizationCount.

Doc from java.lang.management.MemoryMXBean.getObjectPendingFinalizationCount.

Returns the approximate number of objects for which finalization is pending.

Annotations
@SuppressWarnings:deprecation
getTotalGcCpuTimeback to summary
public long getTotalGcCpuTime()

Overrides default java.lang.management.MemoryMXBean.getTotalGcCpuTime.

Doc from java.lang.management.MemoryMXBean.getTotalGcCpuTime.

Returns the approximate accumulated time, in nanoseconds, spent in garbage collection (GC).

The time spent in spent in GC is the CPU time used by all GC activity, including any overhead, which means the result may be non-zero even if no GC has occurred. This method returns -1 if the platform does not support this operation or the information is not available.

isVerboseback to summary
public boolean isVerbose()

Implements java.lang.management.MemoryMXBean.isVerbose.

Doc from java.lang.management.MemoryMXBean.isVerbose.

Tests if verbose output for the memory system is enabled.

setVerboseback to summary
public void setVerbose(boolean value)

Implements java.lang.management.MemoryMXBean.setVerbose.

Doc from java.lang.management.MemoryMXBean.setVerbose.

Enables or disables verbose output for the memory system. The verbose output information and the output stream to which the verbose information is emitted are implementation dependent. Typically, a Java virtual machine implementation prints a message whenever it frees memory at garbage collection.

Each invocation of this method enables or disables verbose output globally.

setVerboseGCback to summary
private native void setVerboseGC(boolean value)