APIdia Launch Partner
Top Description Inners Fields Constructors Methods
sun.management

pack-priv Class MemoryPoolImpl

extends Object
implements MemoryPoolMXBean
Class Inheritance
All Implemented Interfaces
java.lang.management.MemoryPoolMXBean, java.lang.management.PlatformManagedObject
Imports
java.lang.management.ManagementFactory, .MemoryPoolMXBean, .MemoryUsage, .MemoryType, .MemoryManagerMXBean, javax.management.ObjectName

Implementation class for a memory pool. Standard and committed hotspot-specific metrics if any. ManagementFactory.getMemoryPoolMXBeans() returns a list of instances of this class.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class
MemoryPoolImpl.CollectionSensor

CollectionSensor will be triggered and cleared by the VM when the memory usage of a memory pool after GC is crossing the collection threshold.

pack-priv static class
MemoryPoolImpl.PoolSensor

PoolSensor will be triggered by the VM when the memory usage of a memory pool is crossing the usage threshold.

Field Summary

Modifier and TypeField and Description
private long
private final boolean
private final Sensor
private boolean
private final boolean
private final boolean
private MemoryManagerMXBean[]
private final String
private final Sensor
private boolean
private long
private final boolean

Constructor Summary

AccessConstructor and Description
pack-priv
MemoryPoolImpl(String name, boolean isHeap, long usageThreshold, long gcThreshold)

Method Summary

Modifier and TypeMethod and Description
public MemoryUsage
getCollectionUsage()

Implements java.lang.management.MemoryPoolMXBean.getCollectionUsage.

Returns the memory usage after the Java virtual machine most recently expended effort in recycling unused objects in this memory pool.

private native MemoryUsage
public synchronized long
getCollectionUsageThreshold()

Implements java.lang.management.MemoryPoolMXBean.getCollectionUsageThreshold.

Returns the collection usage threshold value of this memory pool in bytes.

public long
getCollectionUsageThresholdCount()

Implements java.lang.management.MemoryPoolMXBean.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.

public String[]
getMemoryManagerNames()

Implements java.lang.management.MemoryPoolMXBean.getMemoryManagerNames.

Returns the name of memory managers that manages this memory pool.

private synchronized MemoryManagerMXBean[]
private native MemoryManagerMXBean[]
public String
getName()

Implements java.lang.management.MemoryPoolMXBean.getName.

Returns the name representing this memory pool.

public ObjectName
getObjectName()

Implements java.lang.management.PlatformManagedObject.getObjectName.

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

public synchronized MemoryUsage
getPeakUsage()

Implements java.lang.management.MemoryPoolMXBean.getPeakUsage.

Returns the peak memory usage of this memory pool since the Java virtual machine was started or since the peak was reset.

private native MemoryUsage
public MemoryType
getType()

Implements java.lang.management.MemoryPoolMXBean.getType.

Returns the type of this memory pool.

public MemoryUsage
getUsage()

Implements java.lang.management.MemoryPoolMXBean.getUsage.

Returns an estimate of the memory usage of this memory pool.

private native MemoryUsage
public synchronized long
getUsageThreshold()

Implements java.lang.management.MemoryPoolMXBean.getUsageThreshold.

Returns the usage threshold value of this memory pool in bytes.

public long
getUsageThresholdCount()

Implements java.lang.management.MemoryPoolMXBean.getUsageThresholdCount.

Returns the number of times that the memory usage has crossed the usage threshold.

public boolean
isCollectionUsageThresholdExceeded()

Implements java.lang.management.MemoryPoolMXBean.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.

public boolean
isCollectionUsageThresholdSupported()

Implements java.lang.management.MemoryPoolMXBean.isCollectionUsageThresholdSupported.

Tests if this memory pool supports a collection usage threshold.

public boolean
isUsageThresholdExceeded()

Implements java.lang.management.MemoryPoolMXBean.isUsageThresholdExceeded.

Tests if the memory usage of this memory pool reaches or exceeds its usage threshold value.

public boolean
isUsageThresholdSupported()

Implements java.lang.management.MemoryPoolMXBean.isUsageThresholdSupported.

Tests if this memory pool supports usage threshold.

public boolean
isValid()

Implements java.lang.management.MemoryPoolMXBean.isValid.

Tests if this memory pool is valid in the Java virtual machine.

public void
resetPeakUsage()

Implements java.lang.management.MemoryPoolMXBean.resetPeakUsage.

Resets the peak memory usage statistic of this memory pool to the current memory usage.

private native void
private native void
setCollectionThreshold0(long current, long newThreshold)

public void
setCollectionUsageThreshold(long newThreshold)

Implements java.lang.management.MemoryPoolMXBean.setCollectionUsageThreshold.

Sets the collection usage threshold of this memory pool to the given threshold value.

private native void
private native void
public void
setUsageThreshold(long newThreshold)

Implements java.lang.management.MemoryPoolMXBean.setUsageThreshold.

Sets the threshold of this memory pool to the given threshold value if this memory pool supports the usage threshold.

private native void
setUsageThreshold0(long current, long newThreshold)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

collectionThresholdback to summary
private long collectionThreshold
collectionThresholdSupportedback to summary
private final boolean collectionThresholdSupported
gcSensorback to summary
private final Sensor gcSensor
gcSensorRegisteredback to summary
private boolean gcSensorRegistered
isHeapback to summary
private final boolean isHeap
isValidback to summary
private final boolean isValid
managersback to summary
private MemoryManagerMXBean[] managers
nameback to summary
private final String name
usageSensorback to summary
private final Sensor usageSensor
usageSensorRegisteredback to summary
private boolean usageSensorRegistered
usageThresholdback to summary
private long usageThreshold
usageThresholdSupportedback to summary
private final boolean usageThresholdSupported

Constructor Detail

MemoryPoolImplback to summary
pack-priv MemoryPoolImpl(String name, boolean isHeap, long usageThreshold, long gcThreshold)

Method Detail

getCollectionUsageback to summary
public MemoryUsage getCollectionUsage()

Implements java.lang.management.MemoryPoolMXBean.getCollectionUsage.

Doc from java.lang.management.MemoryPoolMXBean.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.

getCollectionUsage0back to summary
private native MemoryUsage getCollectionUsage0()
getCollectionUsageThresholdback to summary
public synchronized long getCollectionUsageThreshold()

Implements java.lang.management.MemoryPoolMXBean.getCollectionUsageThreshold.

Doc from java.lang.management.MemoryPoolMXBean.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.

getCollectionUsageThresholdCountback to summary
public long getCollectionUsageThresholdCount()

Implements java.lang.management.MemoryPoolMXBean.getCollectionUsageThresholdCount.

Doc from java.lang.management.MemoryPoolMXBean.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.

getMemoryManagerNamesback to summary
public String[] getMemoryManagerNames()

Implements java.lang.management.MemoryPoolMXBean.getMemoryManagerNames.

Doc from java.lang.management.MemoryPoolMXBean.getMemoryManagerNames.

Returns the name of memory managers that manages this memory pool. Each memory pool will be managed by at least one memory manager.

getMemoryManagersback to summary
private synchronized MemoryManagerMXBean[] getMemoryManagers()
getMemoryManagers0back to summary
private native MemoryManagerMXBean[] getMemoryManagers0()
getNameback to summary
public String getName()

Implements java.lang.management.MemoryPoolMXBean.getName.

Doc from java.lang.management.MemoryPoolMXBean.getName.

Returns the name representing this memory pool.

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.

getPeakUsageback to summary
public synchronized MemoryUsage getPeakUsage()

Implements java.lang.management.MemoryPoolMXBean.getPeakUsage.

Doc from java.lang.management.MemoryPoolMXBean.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.

getPeakUsage0back to summary
private native MemoryUsage getPeakUsage0()
getTypeback to summary
public MemoryType getType()

Implements java.lang.management.MemoryPoolMXBean.getType.

Doc from java.lang.management.MemoryPoolMXBean.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.

getUsageback to summary
public MemoryUsage getUsage()

Implements java.lang.management.MemoryPoolMXBean.getUsage.

Doc from java.lang.management.MemoryPoolMXBean.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.

getUsage0back to summary
private native MemoryUsage getUsage0()
getUsageThresholdback to summary
public synchronized long getUsageThreshold()

Implements java.lang.management.MemoryPoolMXBean.getUsageThreshold.

Doc from java.lang.management.MemoryPoolMXBean.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.

getUsageThresholdCountback to summary
public long getUsageThresholdCount()

Implements java.lang.management.MemoryPoolMXBean.getUsageThresholdCount.

Doc from java.lang.management.MemoryPoolMXBean.getUsageThresholdCount.

Returns the number of times that the memory usage has crossed the usage threshold.

isCollectionUsageThresholdExceededback to summary
public boolean isCollectionUsageThresholdExceeded()

Implements java.lang.management.MemoryPoolMXBean.isCollectionUsageThresholdExceeded.

Doc from java.lang.management.MemoryPoolMXBean.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.

isCollectionUsageThresholdSupportedback to summary
public boolean isCollectionUsageThresholdSupported()

Implements java.lang.management.MemoryPoolMXBean.isCollectionUsageThresholdSupported.

Doc from java.lang.management.MemoryPoolMXBean.isCollectionUsageThresholdSupported.

Tests if this memory pool supports a collection usage threshold.

isUsageThresholdExceededback to summary
public boolean isUsageThresholdExceeded()

Implements java.lang.management.MemoryPoolMXBean.isUsageThresholdExceeded.

Doc from java.lang.management.MemoryPoolMXBean.isUsageThresholdExceeded.

Tests if the memory usage of this memory pool reaches or exceeds its usage threshold value.

isUsageThresholdSupportedback to summary
public boolean isUsageThresholdSupported()

Implements java.lang.management.MemoryPoolMXBean.isUsageThresholdSupported.

Doc from java.lang.management.MemoryPoolMXBean.isUsageThresholdSupported.

Tests if this memory pool supports usage threshold.

isValidback to summary
public boolean isValid()

Implements java.lang.management.MemoryPoolMXBean.isValid.

Doc from java.lang.management.MemoryPoolMXBean.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.

resetPeakUsageback to summary
public void resetPeakUsage()

Implements java.lang.management.MemoryPoolMXBean.resetPeakUsage.

Doc from java.lang.management.MemoryPoolMXBean.resetPeakUsage.

Resets the peak memory usage statistic of this memory pool to the current memory usage.

resetPeakUsage0back to summary
private native void resetPeakUsage0()
setCollectionThreshold0back to summary
private native void setCollectionThreshold0(long current, long newThreshold)
setCollectionUsageThresholdback to summary
public void setCollectionUsageThreshold(long newThreshold)

Implements java.lang.management.MemoryPoolMXBean.setCollectionUsageThreshold.

Doc from java.lang.management.MemoryPoolMXBean.setCollectionUsageThreshold.

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.

setPoolCollectionSensorback to summary
private native void setPoolCollectionSensor(Sensor s)
setPoolUsageSensorback to summary
private native void setPoolUsageSensor(Sensor s)
setUsageThresholdback to summary
public void setUsageThreshold(long newThreshold)

Implements java.lang.management.MemoryPoolMXBean.setUsageThreshold.

Doc from java.lang.management.MemoryPoolMXBean.setUsageThreshold.

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.

setUsageThreshold0back to summary
private native void setUsageThreshold0(long current, long newThreshold)
sun.management back to summary

pack-priv Class MemoryPoolImpl.CollectionSensor

extends Sensor
Class Inheritance

CollectionSensor will be triggered and cleared by the VM when the memory usage of a memory pool after GC is crossing the collection threshold. The VM will trigger this sensor in subsequent crossing regardless if the memory usage has changed since the previous GC.

Field Summary

Modifier and TypeField and Description
pack-priv final MemoryPoolImpl

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv void
pack-priv void
pack-priv void
Inherited from sun.management.Sensor:
clearcleargetCountgetNameisOntoStringtriggertriggertrigger

Field Detail

poolback to summary
pack-priv final MemoryPoolImpl pool

Constructor Detail

CollectionSensorback to summary
pack-priv CollectionSensor(MemoryPoolImpl pool, String name)

Method Detail

clearActionback to summary
pack-priv void clearAction()

Implements abstract sun.management.Sensor.clearAction.

triggerActionback to summary
pack-priv void triggerAction(MemoryUsage usage)

Implements abstract sun.management.Sensor.triggerAction.

triggerActionback to summary
pack-priv void triggerAction()

Implements abstract sun.management.Sensor.triggerAction.

sun.management back to summary

pack-priv Class MemoryPoolImpl.PoolSensor

extends Sensor
Class Inheritance

PoolSensor will be triggered by the VM when the memory usage of a memory pool is crossing the usage threshold. The VM will not trigger this sensor in subsequent crossing unless the memory usage has returned below the threshold.

Field Summary

Modifier and TypeField and Description
pack-priv final MemoryPoolImpl

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv void
pack-priv void
pack-priv void
Inherited from sun.management.Sensor:
clearcleargetCountgetNameisOntoStringtriggertriggertrigger

Field Detail

poolback to summary
pack-priv final MemoryPoolImpl pool

Constructor Detail

PoolSensorback to summary
pack-priv PoolSensor(MemoryPoolImpl pool, String name)

Method Detail

clearActionback to summary
pack-priv void clearAction()

Implements abstract sun.management.Sensor.clearAction.

triggerActionback to summary
pack-priv void triggerAction(MemoryUsage usage)

Implements abstract sun.management.Sensor.triggerAction.

triggerActionback to summary
pack-priv void triggerAction()

Implements abstract sun.management.Sensor.triggerAction.