com.ibm.lang.management
Class MemoryMXBeanImpl
- java.lang.Object
com.ibm.lang.management.DynamicMXBeanImpl
com.ibm.lang.management.MemoryMXBeanImpl
All implemented interfaces:
java.lang.management.MemoryMXBean, javax.management.DynamicMBean, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter
- public final class MemoryMXBeanImpl
- extends DynamicMXBeanImpl
- implements MemoryMXBean, javax.management.NotificationEmitter
Runtime type for
MemoryMXBean
.
Implementation note. This type of bean is both dynamic and a notification
emitter. The dynamic behaviour comes courtesy of the
DynamicMXBeanImpl
superclass while the
notifying behaviour uses a delegation approach to a private member that
implements the NotificationEmitter
interface.
Because multiple inheritance is not supported in Java it was a toss up which
behaviour would be based on inheritence and which would use delegation. Every
other *MXBeanImpl
class in this package inherits from the
abstract base class DynamicMXBeanImpl
so that seemed to be the
natural approach for this class too. By choosing not to make this class a
subclass of NotificationBroadcasterSupport
, the
protected
handleNotification(javax.management.NotificationListener, javax.management.Notification, java.lang.Object)
method cannot be overridden for any custom notification behaviour. However,
taking the agile mantra of YAGNI to heart, it was decided that the
default implementation of that method will suffice until new requirements
prove otherwise.
Since:
1.5
Field Summary
Method Summary
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail
gc
- public void gc()
Specified by:
gc
in interface java.lang.management.MemoryMXBean
getHeapMemoryUsage
- public java.lang.management.MemoryUsage getHeapMemoryUsage(
)
Specified by:
getHeapMemoryUsage
in interface java.lang.management.MemoryMXBean
Returns:
an instance of MemoryUsage
which can be interrogated by
the caller.
getNonHeapMemoryUsage
- public java.lang.management.MemoryUsage getNonHeapMemoryUsage(
)
Specified by:
getNonHeapMemoryUsage
in interface java.lang.management.MemoryMXBean
Returns:
an instance of MemoryUsage
which can be interrogated by
the caller.
getObjectPendingFinalizationCount
- public int getObjectPendingFinalizationCount(
)
Specified by:
getObjectPendingFinalizationCount
in interface java.lang.management.MemoryMXBean
Returns:
the number of objects awaiting finalization.
isVerbose
- public boolean isVerbose()
Specified by:
isVerbose
in interface java.lang.management.MemoryMXBean
Returns:
true
if verbose output is being produced ;
false
otherwise.
setVerbose
- public void setVerbose(boolean value)
Specified by:
setVerbose
in interface java.lang.management.MemoryMXBean
Parameters:
value
- true
enables verbose output ;
false
disables verbose output.
See Also:
ManagementPermission
getMaxHeapSizeLimit
- public long getMaxHeapSizeLimit(
)
Returns:
value of -Xmx in bytes
getMaxHeapSize
- public long getMaxHeapSize()
Returns:
current value of -Xsoftmx in bytes
getMinHeapSize
- public long getMinHeapSize()
Returns:
value of -Xms in bytes
setMaxHeapSize
- public void setMaxHeapSize(long size)
Parameters:
size
- new -Xsoftmx value in bytes
isSetMaxHeapSizeSupported
- public boolean isSetMaxHeapSizeSupported(
)
Returns:
true if setMaxHeapSize is supported, false otherwise
removeNotificationListener
- public void removeNotificationListener(
javax.management.NotificationListener listener,
- javax.management.NotificationFilter filter,
- java.lang.Object handback)
- throws javax.management.ListenerNotFoundException
Specified by:
removeNotificationListener
in interface javax.management.NotificationEmitter
Throws:
javax.management.ListenerNotFoundException
addNotificationListener
- public void addNotificationListener(
javax.management.NotificationListener listener,
- javax.management.NotificationFilter filter,
- java.lang.Object handback)
- throws java.lang.IllegalArgumentException
Specified by:
addNotificationListener
in interface javax.management.NotificationBroadcaster
Throws:
java.lang.IllegalArgumentException
removeNotificationListener
- public void removeNotificationListener(
javax.management.NotificationListener listener)
- throws javax.management.ListenerNotFoundException
Specified by:
removeNotificationListener
in interface javax.management.NotificationBroadcaster
Throws:
javax.management.ListenerNotFoundException
getNotificationInfo
- public javax.management.MBeanNotificationInfo[] getNotificationInfo(
)
Specified by:
getNotificationInfo
in interface javax.management.NotificationBroadcaster
sendNotification
- public void sendNotification(javax.management.Notification notification)
getSharedClassCacheSize
- public long getSharedClassCacheSize(
)
Returns:
the number of bytes in the shared class cache.
getSharedClassCacheFreeSpace
- public long getSharedClassCacheFreeSpace(
)
Returns:
the number of bytes free in the shared class cache.
getGCMode
- public java.lang.String getGCMode(
)
Returns:
a String describing the mode the GC is currently operating in
Description copied from interface:
java.lang.management.MemoryMXBean