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

Overview

Java System Monitor is lightweight library for monitoring Java Virtual Machine (JVM) and system-level CPU and memory usage. It provides several monitoring strategies to suit different use cases, from background monitoring to on-demand resource checks.

Written in pure Java without JNI or JNA, the library is designed to be lightweight, easy to use, and performant, making it suitable for both development and production environments. It is not designed to substitute comprehensive hardware and platform-specific solutions like OSHI.

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 update thresholds
BackgroundSystemMonitor Continuous monitoring with a background thread with configurable update 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