-
Notifications
You must be signed in to change notification settings - Fork 0
Home
zhenya edited this page Aug 9, 2025
·
10 revisions
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.
- 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 |
The library also provides utility classes for common tasks:
- The
SystemMonitorinterface provides static utility methods for retrieving basic JVM and system information - The
Formatterclass can be used to produce human-readable formats of CPU percentages and memory byte values