Class: sun.management.MemoryPoolImpl
- class MemoryPoolImpl
- implements MemoryPoolMXBean
Methods
-
MemoryPoolImpltop
MemoryPoolImpl(String name, boolean isHeap, long usageThreshold, long gcThreshold) -
getCollectionUsagetop
public MemoryUsage getCollectionUsage()Returns the memory usage after the Java virtual machine most recently expended effort in recycling unused objects in this memory pool. This method does not request the Java virtual machine to perform any garbage collection other than its normal automatic memory management. This method returns null if the Java virtual machine does not support this method.MBeanServer access:
The mapped type of MemoryUsage is CompositeData with attributes as specified in MemoryUsage.- Specified by:
- getCollectionUsage from MemoryPoolMXBean
-
getCollectionUsage0top
native private MemoryUsage getCollectionUsage0() -
getCollectionUsageThresholdtop
public synchronized long getCollectionUsageThreshold()Returns the collection usage threshold value of this memory pool in bytes. The default value is zero. The collection usage threshold can be changed via the setCollectionUsageThreshold method.- Specified by:
- getCollectionUsageThreshold from MemoryPoolMXBean
-
getCollectionUsageThresholdCounttop
public long getCollectionUsageThresholdCount()Returns the number of times that the Java virtual machine has detected that the memory usage has reached or exceeded the collection usage threshold.- Specified by:
- getCollectionUsageThresholdCount from MemoryPoolMXBean
-
getMemoryManagerNamestop
public String[] getMemoryManagerNames()Returns the name of memory managers that manages this memory pool. Each memory pool will be managed by at least one memory manager.- Specified by:
- getMemoryManagerNames from MemoryPoolMXBean
-
getMemoryManagerstop
synchronized private MemoryManagerMXBean[] getMemoryManagers() -
getMemoryManagers0top
native private MemoryManagerMXBean[] getMemoryManagers0() -
getNametop
public String getName()Returns the name representing this memory pool.- Specified by:
- getName from MemoryPoolMXBean
-
getPeakUsagetop
public synchronized MemoryUsage getPeakUsage()Returns the peak memory usage of this memory pool since the Java virtual machine was started or since the peak was reset. This method returns null if this memory pool is not valid (i.e. no longer exists).MBeanServer access:
The mapped type of MemoryUsage is CompositeData with attributes as specified in MemoryUsage.- Specified by:
- getPeakUsage from MemoryPoolMXBean
-
getPeakUsage0top
native private MemoryUsage getPeakUsage0() -
getTypetop
public MemoryType getType()Returns the type of this memory pool.MBeanServer access:
The mapped type of MemoryType is String and the value is the name of the MemoryType.- Specified by:
- getType from MemoryPoolMXBean
-
getUsagetop
public MemoryUsage getUsage()Returns an estimate of the memory usage of this memory pool. This method returns null if this memory pool is not valid (i.e. no longer exists).This method requests the Java virtual machine to make a best-effort estimate of the current memory usage of this memory pool. For some memory pools, this method may be an expensive operation that requires some computation to determine the estimate. An implementation should document when this is the case.
This method is designed for use in monitoring system memory usage and detecting low memory condition.
MBeanServer access:
The mapped type of MemoryUsage is CompositeData with attributes as specified in MemoryUsage.- Specified by:
- getUsage from MemoryPoolMXBean
-
getUsage0top
native private MemoryUsage getUsage0() -
getUsageThresholdtop
public synchronized long getUsageThreshold()Returns the usage threshold value of this memory pool in bytes. Each memory pool has a platform-dependent default threshold value. The current usage threshold can be changed via the setUsageThreshold method.- Specified by:
- getUsageThreshold from MemoryPoolMXBean
-
getUsageThresholdCounttop
public long getUsageThresholdCount()Returns the number of times that the memory usage has crossed the usage threshold.- Specified by:
- getUsageThresholdCount from MemoryPoolMXBean
-
isCollectionUsageThresholdExceededtop
public boolean isCollectionUsageThresholdExceeded()Tests if the memory usage of this memory pool after the most recent collection on which the Java virtual machine has expended effort has reached or exceeded its collection usage threshold. This method does not request the Java virtual machine to perform any garbage collection other than its normal automatic memory management.- Specified by:
- isCollectionUsageThresholdExceeded from MemoryPoolMXBean
-
isCollectionUsageThresholdSupportedtop
public boolean isCollectionUsageThresholdSupported()Tests if this memory pool supports a collection usage threshold.- Specified by:
- isCollectionUsageThresholdSupported from MemoryPoolMXBean
-
isUsageThresholdExceededtop
public boolean isUsageThresholdExceeded()Tests if the memory usage of this memory pool reaches or exceeds its usage threshold value.- Specified by:
- isUsageThresholdExceeded from MemoryPoolMXBean
-
isUsageThresholdSupportedtop
public boolean isUsageThresholdSupported()Tests if this memory pool supports usage threshold.- Specified by:
- isUsageThresholdSupported from MemoryPoolMXBean
-
isValidtop
public boolean isValid()Tests if this memory pool is valid in the Java virtual machine. A memory pool becomes invalid once the Java virtual machine removes it from the memory system.- Specified by:
- isValid from MemoryPoolMXBean
-
resetPeakUsagetop
public void resetPeakUsage()Resets the peak memory usage statistic of this memory pool to the current memory usage.- Specified by:
- resetPeakUsage from MemoryPoolMXBean
-
resetPeakUsage0top
native private void resetPeakUsage0() -
setCollectionThreshold0top
native private void setCollectionThreshold0(long current, long newThreshold) -
setCollectionUsageThresholdtop
public void setCollectionUsageThreshold(long newThreshold)Sets the collection usage threshold of this memory pool to the given threshold value. When this threshold is set to positive, the Java virtual machine will check the memory usage at its best appropriate time after it has expended effort in recycling unused objects in this memory pool.The collection usage threshold crossing checking is enabled in this memory pool if the threshold is set to a positive value. The collection usage threshold crossing checking is disabled if it is set to zero.
- Specified by:
- setCollectionUsageThreshold from MemoryPoolMXBean
-
setPoolCollectionSensortop
native private void setPoolCollectionSensor(Sensor s) -
setPoolUsageSensortop
native private void setPoolUsageSensor(Sensor s) -
setUsageThresholdtop
public void setUsageThreshold(long newThreshold)Sets the threshold of this memory pool to the given threshold value if this memory pool supports the usage threshold. The usage threshold crossing checking is enabled in this memory pool if the threshold is set to a positive value. The usage threshold crossing checking is disabled if it is set to zero.- Specified by:
- setUsageThreshold from MemoryPoolMXBean
-
setUsageThreshold0top
native private void setUsageThreshold0(long current, long newThreshold)
Fields
-
collectionThreshold
private long collectionThreshold -
collectionThresholdSupported
final private boolean collectionThresholdSupported -
gcSensor
private Sensor gcSensor -
gcSensorRegistered
private boolean gcSensorRegistered -
isHeap
final private boolean isHeap -
isValid
final private boolean isValid -
managers
private MemoryManagerMXBean[] managers -
name
final private String name -
usageSensor
private Sensor usageSensor -
usageSensorRegistered
private boolean usageSensorRegistered -
usageThreshold
private long usageThreshold -
usageThresholdSupported
final private boolean usageThresholdSupported
