Skip to content
zhenya edited this page Aug 9, 2025 · 10 revisions

Overview

Java System Monitor is a lightweight library for monitoring Java Virtual Machine (JVM) and system-level resource usage such as CPU and memory in Java.

The library is designed to be lightweight, easy to use, and performant, making it suitable for both development and production environments. It provides several monitoring strategies to suit different use cases, from background monitoring to on-demand resource checks.

Key features

  • CPU (process and system-wide) and memory usage monitoring
  • Point-in-time and aggregate (average / maximum) metrics
  • Multiple monitoring strategies (lazy, background)
  • Minimal overhead
  • Thread-safe implementations for concurrent use
  • 100% pure Java, no external dependencies

The library provides two main monitoring implementations:

Monitor Type Use Case
LazySystemMonitor On-demand monitoring with configurable refresh thresholds
BackgroundSystemMonitor Continuous monitoring with a background thread with configurable refresh interval

Utility Classes

The library also provides utility classes for common tasks:

  • The SystemMonitor interface provides static utility methods for retrieving basic JVM and system information
  • The Formatter class can be used to produce human-readable formats of CPU percentages and memory byte values
Clone this wiki locally