Memory Monitoring and Management Platform MBeans

From NovaOrdis Knowledge Base
Jump to navigation Jump to search

External

Internal

Memory MBean

http://docs.oracle.com/javase/8/docs/api/java/lang/management/MemoryMXBean.html

The Memory MBean implements the MemoryMXBean interface, and exists as a singleton instance in the JVM. The MBean instance is accessible from the platform MBean server, either programmatically by calling ManagementFactory.getMemoryMXBean() method, or by looking up the "java.lang:type=Memory" JMX ObjectName.

The Memory MBean exposes information about the heap and the non-heap memory. Heap and non-heap memory information is returned as snapshots in the form of MemoryUsage instances.

The Memory MBean also exposes the "ObjectPendingFinalizationCount" JMX attribute, which is the approximate number for which finalization is pending.

MemoryUsage Instance

http://docs.oracle.com/javase/8/docs/api/java/lang/management/MemoryUsage.html

MemoryUsage instances represent memory snapshots, and they are used by the JVM to represent both heap and non-heap memory pools. The memory pool snapshot is characterized by four values:

  • init - represents the initial amount in bytes the JVM requests from the O/S during startup, for this pool.
  • used - represents the amount of used memory, for this pool, in bytes.
  • committed - represents the amount of memory (in bytes) that is guaranteed to be available for use by the Java virtual machine. The amount of committed memory may change over time (increase or decrease). The Java virtual machine may release memory to the system and committed could be less than init. committed will always be greater than or equal to used.
  • max -

Memory Pool MBeans