Class: sun.management.MemoryImpl
- class MemoryImpl
- extends NotificationEmitterSupport
- implements MemoryMXBean
Inheritance
Superclass tree:- java.lang.Object
- sun.management.NotificationEmitterSupport
- sun.management.MemoryImpl
Methods
-
MemoryImpltop
MemoryImpl(VMManagement vm)Constructor of MemoryImpl class -
createNotificationtop
-
gctop
public void gc()Runs the garbage collector. The callgc()is effectively equivalent to the call:System.gc()
- Specified by:
- gc from MemoryMXBean
-
getHeapMemoryUsagetop
public MemoryUsage 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.- Specified by:
- getHeapMemoryUsage from MemoryMXBean
-
getMemoryManagerstop
static synchronized MemoryManagerMXBean[] getMemoryManagers() -
getMemoryManagers0top
static native private MemoryManagerMXBean[] getMemoryManagers0() -
getMemoryPoolstop
static synchronized MemoryPoolMXBean[] getMemoryPools() -
getMemoryPools0top
static native private MemoryPoolMXBean[] getMemoryPools0() -
getMemoryUsage0top
native private MemoryUsage getMemoryUsage0(boolean heap) -
getNextSeqNumbertop
static private long getNextSeqNumber() -
getNonHeapMemoryUsagetop
public MemoryUsage 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.- Specified by:
- getNonHeapMemoryUsage from MemoryMXBean
-
getNotifMsgtop
-
getNotificationInfotop
public MBeanNotificationInfo[] 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.
- Specified by:
- getNotificationInfo from NotificationBroadcaster
- Override hierarchy:
- getNotificationInfo from NotificationEmitterSupport
-
getObjectNametop
static synchronized private ObjectName getObjectName() -
getObjectPendingFinalizationCounttop
public int getObjectPendingFinalizationCount()Returns the approximate number of objects for which finalization is pending.- Specified by:
- getObjectPendingFinalizationCount from MemoryMXBean
-
isVerbosetop
public boolean isVerbose()Tests if verbose output for the memory system is enabled.- Specified by:
- isVerbose from MemoryMXBean
-
setVerbosetop
public void setVerbose(boolean value)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.
- Specified by:
- setVerbose from MemoryMXBean
-
setVerboseGCtop
native private void setVerboseGC(boolean value)
Fields
-
jvm
final private VMManagement jvm -
mgrs
static private MemoryManagerMXBean[] mgrs -
notifInfo
private MBeanNotificationInfo[] notifInfo -
notifMsgs
static final private String[] notifMsgs -
notifName
static final private String notifName = "javax.management.Notification" -
notifTypes
static final private String[] notifTypes -
objname
static private ObjectName objname -
pools
static private MemoryPoolMXBean[] pools -
seqNumber
static private long seqNumber
