Class MonitoringManagementExamples

java.lang.Object
net.jrodolfo.java_evolution.java06.monitoring_management.MonitoringManagementExamples

public class MonitoringManagementExamples extends Object
Demonstrates platform MXBean monitoring APIs improved around Java 6.
  • Constructor Details

    • MonitoringManagementExamples

      public MonitoringManagementExamples()
  • Method Details

    • runtimeName

      public String runtimeName()
      Reads descriptive runtime information for the current JVM.
      Returns:
      JVM runtime name
    • loadedClassCount

      public int loadedClassCount()
      Reads how many classes are currently loaded in this JVM.
      Returns:
      currently loaded class count
    • usedHeapBytes

      public long usedHeapBytes()
      Reads a heap-memory snapshot.
      Returns:
      used heap memory in bytes
    • liveThreadCount

      public int liveThreadCount()
      Reads the current live-thread count.
      Returns:
      live thread count
    • systemLoadAverage

      public double systemLoadAverage()
      Reads the system load average added to the management API in Java 6. A negative value means the operating system does not provide this reading.
      Returns:
      system load average, or a negative value when unavailable
    • snapshot

      Combines several MXBean readings into a compact operational snapshot.
      Returns:
      JVM snapshot