---
title: OS vs JVM Monitoring - When to Use Windows Server vs JMX Monitoring
description: "OS-level vs JVM-level monitoring in Nodinite: the JMX Monitoring Agent monitors JVM CPU and free heap; the Windows Server Monitoring Agent covers server CPU, memory, disk, and Windows Services. Learn when to use each."
---

# :fa-display: OS-Level vs JVM-Level Monitoring

This troubleshooting guide compares **OS monitoring** and **JVM monitoring** so you can choose the right :Nodinite: agent for each layer of a Java workload. The :Nodinite: [JMX Monitoring Agent][JMXAgent] sees inside the JVM, but only two values: **CPU usage** and **free heap**. The operating system layer, such as server CPU, **physical memory**, disk, and services, belongs to the [Windows Server Monitoring Agent][].

## Key Differences

| Value | OS level ([Windows Server Monitoring Agent][]) | JVM level ([JMX Monitoring Agent][JMXAgent]) |
| --- | --- | --- |
| :fa-microchip: **CPU usage** | ✅ Server CPU | ✅ CPU usage of the JVM, with Warning and Error thresholds |
| :fa-layer-group: **Heap memory** | ❌ Not visible from the OS | ✅ Free heap % ([Heap Used vs Committed][]), with Warning and Error thresholds |
| :fa-memory: **Physical memory** | ✅ Server memory | ❌ Not monitored |
| :fa-hard-drive: [Disk][] | ✅ Disk space | ❌ Not monitored |
| :fa-gears: [Windows Services][] | ✅ Service state, with [Remote Actions][] | ❌ Not monitored |
| :fa-plug-circle-xmark: **Reachability** | Server and services | 🚫 Unavailable when the JVM can't be reached over JMX |

The JMX Monitoring Agent doesn't monitor garbage collection, thread counts, class loading, or other MBean attributes ([Supported Garbage Collectors][], [Thread Deadlock Detection][]).

<div class="mermaid">
graph TD
  subgraph "OS layer - Windows Server Monitoring Agent"
    Server["fab:fa-windows Windows Server"]
    OsCpu["fa:fa-microchip Server CPU"]
    OsMem["fa:fa-memory Physical memory"]
    Disk["fa:fa-hard-drive Disk space"]
    Services["fa:fa-gears Windows Services"]
  end
  subgraph "JVM layer - JMX Monitoring Agent"
    Jvm["fab:fa-java Java process"]
    JvmCpu["fa:fa-microchip JVM CPU usage"]
    Heap["fa:fa-layer-group Free heap %"]
  end
  Server --> OsCpu
  Server --> OsMem
  Server --> Disk
  Server --> Services
  Server --> Jvm
  Jvm --> JvmCpu
  Jvm --> Heap
  style Server fill:#2678BD
  style Jvm fill:#2678BD
  style JvmCpu fill:#93d16d
  style Heap fill:#93d16d
</div>

*Diagram: The OS layer and the JVM layer. Green marks the two values the JMX Monitoring Agent monitors, JVM CPU usage and free heap; blue marks the monitored hosts.*

## When to Use OS-Level Monitoring

Use the [Windows Server Monitoring Agent][] for:

* Overall server health: disk space, physical memory, and server CPU
* Windows Services on the server, including the Windows Service that runs the :Nodinite: JMX Gateway
* Non-Java applications on the same server

## When to Use JVM-Level Monitoring

Use the :Nodinite: JMX Monitoring Agent for:

* Warning before a JVM runs out of heap, by alerting on low free heap before an OutOfMemoryError
* CPU usage per JVM, when several JVMs share one server
* Boomi Atoms, WSO2 servers, Spring Boot services, and other JVM-based integration applications

## Using Both Together

For critical Java infrastructure, use both layers:

* :fab fa-windows: **OS monitoring** catches server-wide issues such as a full disk, low physical memory, or a stopped Windows Service
* :fab fa-java: **JMX monitoring** catches JVM issues: high CPU usage in a specific JVM and low free heap

>[!TIP]
>If server CPU is at 100% but JVM CPU is normal, look for a non-Java process. If JVM CPU is high, the load comes from that JVM; capture a thread dump with `jstack <PID>` to see which threads are busy.

## Physical Memory vs Heap Memory

The OS shows the **physical memory** the Java process uses, while the JMX Monitoring Agent shows **heap memory** managed inside the JVM. These are different:

* :fa-memory: **Physical memory** = heap + **off-heap** memory (direct buffers, Metaspace, thread stacks, JIT code)
* :fa-layer-group: **Heap memory** = only the objects managed by the garbage collector
* A JVM with `-Xmx2g` may use 3 GB or more of physical memory when off-heap memory is included

>[!IMPORTANT]
>Monitor free **heap memory** with the JMX Monitoring Agent to catch OutOfMemoryError risk. Monitor **physical memory** with OS monitoring to make sure the server has enough RAM for the JVM, including its off-heap memory, and other processes.

## :fa-hand-point-right: Next Steps

:fab fa-docker: [Docker Container Monitoring][]  
:fa-unlock: [Enable JMX Remote Monitoring][]  

## :fa-link-horizontal: Related Topics

:fa-server: [Multi-JVM Monitoring][]  
:fa-memory: [Heap Used vs Committed][]  
:fab fa-windows: [Windows Server Monitoring Agent][]  
:fab fa-java: [JMX Monitoring Agent][JMXAgent]  
:fa-circle-question: [JMX Troubleshooting Overview][Troubleshooting]  

[Disk]:{ndr}/Logging%20and%20Monitoring/Windows%20Server/Features/Disk.md
[Docker Container Monitoring]:{ndr}/Logging%20and%20Monitoring/JMX/Troubleshooting/Docker%20Container%20Monitoring.md
[Enable JMX Remote Monitoring]:{ndr}/Logging%20and%20Monitoring/JMX/Troubleshooting/Enable%20JMX%20Remote%20Monitoring.md
[Heap Used vs Committed]:{ndr}/Logging%20and%20Monitoring/JMX/Troubleshooting/Heap%20Used%20vs%20Committed.md
[JMXAgent]:{ndr}/Logging%20and%20Monitoring/JMX/Overview.md
[Multi-JVM Monitoring]:{ndr}/Logging%20and%20Monitoring/JMX/Troubleshooting/Multi-JVM%20Monitoring.md
[Remote Actions]:{ndr}/Getting%20Started/3.%20Monitor/Remote%20Actions.md
[Supported Garbage Collectors]:{ndr}/Logging%20and%20Monitoring/JMX/Troubleshooting/Supported%20Garbage%20Collectors.md
[Thread Deadlock Detection]:{ndr}/Logging%20and%20Monitoring/JMX/Troubleshooting/Thread%20Deadlock%20Detection.md
[Troubleshooting]:{ndr}/Logging%20and%20Monitoring/JMX/Troubleshooting/Overview.md
[Windows Server Monitoring Agent]:{ndr}/Logging%20and%20Monitoring/Windows%20Server/Overview.md
[Windows Services]:{ndr}/Logging%20and%20Monitoring/Windows%20Server/Features/Windows%20Services.md