Skip to content

Commit bba6f9d

Browse files
jbachorikclaudeburaizu
authored
docs(profiler): mark Java live heap profiling as GA (#35802)
* docs(profiler): mark Java live heap profiling as GA Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * docs(profiler): fix live heap profiling config key docs - DD_PROFILING_HEAP_ENABLED is the master toggle (gates both ddprof and JFR fallback), not a legacy key - DD_PROFILING_DDPROF_LIVEHEAP_ENABLED is ddprof-specific override only - Split disable instructions into two cases: all vs ddprof-only - Add DD_PROFILING_HEAP_ENABLED to config reference table Rationale: source code in dd-trace-java confirms DD_PROFILING_HEAP_ENABLED gates both engines; previous docs had the relationship backwards * Update content/en/profiler/profiler_troubleshooting/java.md Co-authored-by: Bryce Eadie <bryce.eadie@datadoghq.com> * Update content/en/profiler/profiler_troubleshooting/java.md Co-authored-by: Bryce Eadie <bryce.eadie@datadoghq.com> * Update content/en/profiler/profiler_troubleshooting/java.md Co-authored-by: Bryce Eadie <bryce.eadie@datadoghq.com> * Update content/en/profiler/profile_types.md Co-authored-by: Bryce Eadie <bryce.eadie@datadoghq.com> * Fix formatting --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: Bryce Eadie <bryce.eadie@datadoghq.com>
1 parent 10f4b66 commit bba6f9d

2 files changed

Lines changed: 21 additions & 35 deletions

File tree

content/en/profiler/profile_types.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,9 @@ Allocated Memory
3232
: The amount of heap memory allocated by each method, including allocations which were subsequently freed.<br />
3333
_Requires: Java 11_
3434

35-
Heap Live Objects (in Preview, 1.17.0+)
36-
: The number of objects allocated by each method in heap memory that have not yet been garbage collected. This is useful for investigating the overall memory usage of your service and identifying potential memory leaks.<br />
37-
_Requires: Java 11_ <br />
38-
39-
Heap Live Size (in Preview, 1.39.0+)
40-
: The amount of heap memory allocated by each method that has not yet been garbage collected. This is useful for investigating the overall memory usage of your service and identifying potential memory leaks.<br />
41-
_Requires: Java 11.0.23+, 17.0.11+, 21.0.3+ or 22+_ <br />
35+
Live Heap (v1.61.0+)
36+
: The objects and memory allocated by each method that have not yet been garbage collected. This is useful for investigating the overall memory usage of your service and identifying potential memory leaks. The profiler automatically uses the most accurate engine available for your JVM version.<br />
37+
_Requires: Java 11+_
4238

4339
Wall Time in Native Code
4440
: The elapsed time spent by each method. Elapsed time includes time when code is running on CPU, waiting for I/O, and anything else that happens while the method is running.

content/en/profiler/profiler_troubleshooting/java.md

Lines changed: 18 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -80,41 +80,26 @@ jdk.ObjectAllocationSample#enabled=true
8080

8181
### Live heap profiling
8282

83-
Live Heap Profiling is a Datadog profiler feature that helps identify memory leaks and understand heap usage by tracking which allocated objects survive garbage collection. Unlike standard allocation profiling (which shows what was allocated), live heap profiling shows what is still alive on the heap — making it more useful for diagnosing memory leaks.
83+
Live heap profiling tracks which allocated objects survive garbage collection, making it useful for diagnosing memory leaks and understanding overall heap usage. Starting with dd-trace-java **v1.61.0**, it is **enabled by default** on Linux. The profiler automatically selects the most accurate engine available for your JVM version.
8484

85-
The live-heap profiler engine:
85+
The live-heap profiler:
8686
- Useful for investigating the overall memory usage of your service and identifying potential memory leaks
87-
- Samples allocations and keeps track of whether those samples survived the most recent garbage collection cycle
88-
- Uses the number of surviving samples to estimate the number of live objects in the heap
89-
- Limits the number of tracked samples to avoid unbounded growth of the profiler's memory usage
90-
- Disabled by default
87+
- Samples allocations and tracks whether those samples survived the most recent garbage collection cycle
88+
- Automatically uses the Datadog profiler engine on JDK 11.0.23+, 17.0.11+, 21.0.3+, or 22+, and falls back to the JFR engine (`jdk.OldObjectSample`) on older supported JDK versions
9189
- Not available on Windows
92-
- For JMC users, the Datadog live-heap event is `datadog.HeapLiveObject`
90+
- For JMC users, the Datadog live-heap event is `datadog.HeapLiveObject`; the JFR fallback emits `jdk.OldObjectSample`
9391

94-
| Configuration | Environment Variable | System Property |
95-
|---------------|---------------------|-----------------|
96-
| **Enable** (Requires JDK 11.0.23+, 17.0.11+, 21.0.3+, or 22+) | `DD_PROFILING_DDPROF_LIVEHEAP_ENABLED=true` | `-Ddd.profiling.ddprof.liveheap.enabled=true` |
97-
98-
**Note**: The live-heap engine does not depend on the `/proc/sys/kernel/perf_event_paranoid` setting.
99-
100-
101-
### Heap profiling
102-
103-
Heap profiling uses the JVM's built-in `jdk.OldObjectSample` JFR event to track objects that have been live in the heap for a sustained period of time. This helps identify potential memory leaks by showing which objects are accumulating over time. Unlike live heap profiling (which uses the Datadog profiler engine), heap profiling relies on JFR and is available on all platforms where JFR is supported.
104-
105-
<div class="alert alert-info">This feature requires at least Java 11.0.12, 15.0.4, 16.0.2, 17.0.3 or 18 and newer</div>
106-
107-
To enable the heap profiler, start your application with one of the following:
92+
To disable live heap profiling entirely (both Datadog engine and JFR fallback):
10893

10994
| Environment Variable | System Property |
11095
|---------------------|-----------------|
111-
| `DD_PROFILING_HEAP_ENABLED=true` | `-Ddd.profiling.heap.enabled=true` |
96+
| `DD_PROFILING_HEAP_ENABLED=false` | `-Ddd.profiling.heap.enabled=false` |
11297

113-
Alternatively, you can enable the following events in your `jfp` [override template file](#creating-and-using-a-jfr-template-override-file):
98+
To disable only the Datadog native engine implementation (the JFR fallback `jdk.OldObjectSample` remains active on older JDKs):
11499

115-
```
116-
jdk.OldObjectSample#enabled=true
117-
```
100+
| Environment Variable | System Property |
101+
|---------------------|-----------------|
102+
| `DD_PROFILING_DDPROF_LIVEHEAP_ENABLED=false` | `-Ddd.profiling.ddprof.liveheap.enabled=false` |
118103

119104

120105
### Heap histogram metrics
@@ -142,13 +127,18 @@ The [Trace to Profiling integration][3] identifies code hotspots in slow traces.
142127

143128
The following settings allow fine-grained control over the profiler engines. These are typically not needed for standard use cases. For detailed information about each profiler type, see the corresponding sections above: [CPU profiling](#cpu-profiling), [Wallclock](#wallclock), [Allocation profiling](#allocation-profiling), and [Live heap profiling](#live-heap-profiling).
144129

130+
**Note**:
131+
- `DD_PROFILING_HEAP_ENABLED` controls all live heap profiling. Setting it to `false` disables both the Datadog native engine and the JFR `jdk.OldObjectSample` fallback.
132+
- `DD_PROFILING_DDPROF_LIVEHEAP_ENABLED` only controls the Datadog native engine. The JFR fallback is unaffected by this setting.
133+
145134
| Environment variable | System property | Description |
146135
|---------------------|-----------------|-------------|
136+
| `DD_PROFILING_HEAP_ENABLED` | `-Ddd.profiling.heap.enabled` | Main toggle for all live heap profiling, including both the Datadog native engine and the JFR `jdk.OldObjectSample` fallback (default: true on supported platforms since v1.61.0) |
147137
| `DD_PROFILING_DDPROF_ENABLED` | `-Ddd.profiling.ddprof.enabled` | Enable the Datadog profiler engine (Linux only, default: true since v1.7.0) |
148138
| `DD_PROFILING_DDPROF_CPU_ENABLED` | `-Ddd.profiling.ddprof.cpu.enabled` | Enable CPU profiling with the Datadog engine |
149139
| `DD_PROFILING_DDPROF_WALL_ENABLED` | `-Ddd.profiling.ddprof.wall.enabled` | Enable wallclock profiling (default: true since v1.7.0) |
150140
| `DD_PROFILING_DDPROF_ALLOC_ENABLED` | `-Ddd.profiling.ddprof.alloc.enabled` | Enable allocation profiling with the Datadog engine |
151-
| `DD_PROFILING_DDPROF_LIVEHEAP_ENABLED` | `-Ddd.profiling.ddprof.liveheap.enabled` | Enable live heap profiling (requires JDK 11.0.23+, 17.0.11+, 21.0.3+, or 22+) |
141+
| `DD_PROFILING_DDPROF_LIVEHEAP_ENABLED` | `-Ddd.profiling.ddprof.liveheap.enabled` | Override for the Datadog native engine live heap implementation only; does not affect the JFR fallback (default: enabled on supported JDK versions (11.0.23+, 17.0.11+, 21.0.3+, or 22+), requires `DD_PROFILING_HEAP_ENABLED=true`) |
152142
| `DD_PROFILING_ENABLED_EVENTS` | `-Ddd.profiling.enabled.events` | Enable specific JFR events (for example: `jdk.ObjectAllocationInNewTLAB,jdk.ObjectAllocationOutsideTLAB`) |
153143

154144
### JDK Mission Control (JMC) event reference
@@ -160,7 +150,7 @@ If you are analyzing profiles with JDK Mission Control, the following table prov
160150
| CPU | `jdk.ExecutionSample` | `datadog.ExecutionSample` |
161151
| Wallclock | - | `datadog.MethodSample` |
162152
| Allocation | `jdk.ObjectAllocationInNewTLAB`, `jdk.ObjectAllocationOutsideTLAB` | `datadog.ObjectAllocationInNewTLAB`, `datadog.ObjectAllocationOutsideTLAB` |
163-
| Live heap | - | `datadog.HeapLiveObject` |
153+
| Live heap | `jdk.OldObjectSample` | `datadog.HeapLiveObject` |
164154

165155

166156
## Advanced configuration

0 commit comments

Comments
 (0)