---
title: Heap Used vs Committed Memory - JMX Monitoring Guide
description: Understand JVM heap used, committed, and max memory, and how the Nodinite JMX Monitoring Agent uses free heap with Heap Size thresholds to warn before an OutOfMemoryError impacts production.
---

# :fa-memory: Heap Used vs Committed Memory

This troubleshooting guide explains the difference between **heap used** and **heap committed** memory so you can improve **memory monitoring** with the :Nodinite: [JMX Monitoring Agent][JMXAgent].

## Understanding JVM Heap Memory

The JVM manages **JVM memory** in a heap divided into regions. Two key metrics help you understand heap health and set each **monitoring threshold** correctly:

| Metric | Description | When It Changes |
|---|---|---|
| :fa-memory: **Heap Used** | Memory actively occupied by live objects | After every garbage collection cycle |
| :fa-box-archive: **Heap Committed** | Memory reserved (committed) by the OS for the JVM | Grows up to `-Xmx` as demand increases |
| :fa-arrow-up-wide-short: **Heap Max** | Maximum heap size configured via `-Xmx` | Set at JVM startup, rarely changes |

<div class="mermaid">
graph LR
  subgraph "JVM Heap"
    A["Heap Used (live objects)"]
    B["Heap Committed (reserved by OS)"]
    C["Heap Max (-Xmx limit)"]
  end
  A -->|"grows until GC"| B
  B -->|"grows until"| C
  C -->|"exceeded triggers"| D["OutOfMemoryError"]
  style A fill:#93d16d
  style B fill:#FFD525
  style C fill:#c33d34
  style D fill:#c33d34
</div>

*Diagram: Relationship between heap used (green), committed (yellow), and max (red), showing how unchecked growth leads to OutOfMemoryError.*

## Which Value Does Nodinite Monitor?

The :Nodinite: JMX Monitoring Agent monitors **free heap** in percent, the part of the heap not occupied by live objects, and compares it with the **Heap Size** thresholds in the [Configuration][]. The thresholds are the minimum free heap: the JVM Resource changes to Warning or Error when free heap drops below them for the configured Duration. Low free heap is the most reliable sign of memory pressure and the basis for a **monitoring threshold** that catches **heap exhaustion** early. The agent doesn't report heap used, committed, and max as separate values.

### Recommended Threshold Values

| Environment | Warning Threshold % (free heap below) | Error Threshold % (free heap below) | Notes |
|---|---|---|---|
| Development | 20% | 10% | Allow higher usage for testing |
| Test / QA | 25% | 15% | Balance early detection with noise |
| Production | 30% | 20% | Detect heap exhaustion early |

>[!TIP]
>
>Set the **Warning** threshold 10–15 percentage points above the **Error** threshold (more free heap). This gives operators time to investigate before the Error state.

## Common Questions

### Why does heap used spike after deployments?

New application code loaded into memory after a deployment increases **used memory** temporarily. Allow 5–10 minutes for the JVM to stabilize, or set a Duration long enough that the warm-up doesn't change the [Resource][Resources] state.

### Why is heap committed higher than heap used?

The JVM reserves **committed memory** beyond active **memory allocation** to avoid frequent OS memory allocation calls. Committed memory grows as heap demand increases but does not shrink automatically until a full GC or JVM restart.

### When should I adjust thresholds?

Adjust thresholds after:

* Adding new integration flows that process larger message payloads
* Upgrading the JVM or application framework
* Observing repeated false-positive warnings during normal operation

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

:fa-trash-can: [Supported Garbage Collectors][]  
:fa-chart-line: [Correlate Heap Spikes][]  

## :fa-link-horizontal: Related Topics

:fa-sliders: [Environment-Specific Thresholds][]  
:fa-circle-question: [JMX Troubleshooting Overview][Troubleshooting]  
:fab fa-java: [JMX Monitoring Agent][JMXAgent]  

[Configuration]:{ndr}/Logging%20and%20Monitoring/JMX/Getting%20started/3.%20Configuration.md
[Correlate Heap Spikes]:{ndr}/Logging%20and%20Monitoring/JMX/Troubleshooting/Correlate%20Heap%20Spikes.md
[Environment-Specific Thresholds]:{ndr}/Logging%20and%20Monitoring/JMX/Troubleshooting/Environment-Specific%20Thresholds.md
[JMXAgent]:{ndr}/Logging%20and%20Monitoring/JMX/Overview.md
[Resources]:{ndr}/Administration/2.%20Monitor%20Management/3.%20Resources/Features/What%20is%20a%20Resource.md
[Supported Garbage Collectors]:{ndr}/Logging%20and%20Monitoring/JMX/Troubleshooting/Supported%20Garbage%20Collectors.md
[Troubleshooting]:{ndr}/Logging%20and%20Monitoring/JMX/Troubleshooting/Overview.md