[PROF-15376] Profiling: Disable live heap size profiling on Ruby 4 due to incompatibility#6022
Conversation
…e to incompatibility **What does this PR do?** The profiler supports two profile types related to heap profiling: * Heap Live Objects * Heap Live Size This PR disables "Heap Live Size" on Ruby 4.0, leaving only "Heap Live Objects" available. **Motivation:** We've had reports of issues (such as #5936 when using heap live size on Ruby 4.0). We've previously added a workaround in #5938 but we're now seeing issues with many different kinds of objects, not just classes, and thus we're disabling this feature on Ruby 4.0 until we can root cause the issue and fix it. **Additional Notes:** This is how the message looks in practice: ``` I, [2026-07-10T11:24:56.368794 #2947286] INFO -- datadog: [datadog] Heap live size profiling is currently incompatible with Ruby 4 and has been disabled. Heap live objects is not affected and remains enabled. ``` **How to test the change?** I've included tests for this config change.
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: 9d01d28 | Docs | Datadog PR Page | Give us feedback! |
BenchmarksBenchmark execution time: 2026-07-10 11:55:57 Comparing candidate commit 9d01d28 in PR branch Found 2 performance improvements and 0 performance regressions! Performance is the same for 46 metrics, 1 unstable metrics.
|
…tible with Ruby 4 (#38117) **What does this PR do?** Update profiler docs to reflect the fact that heap live size profiling is currently not compatible with Ruby 4, as per PROF-15376 JIRA and DataDog/dd-trace-rb#6022 . (Heap live objects profiling is unaffected.) I did spot that vale doesn't like the word "currently" yet I believe that's the most accurate representation of the state here -- we've had to disable the feature due to bugs, but we do intent to restore it in the future.
What does this PR do?
The profiler supports two profile types related to heap profiling:
This PR disables "Heap Live Size" on Ruby 4.0, leaving only "Heap Live Objects" available.
Motivation:
We've had reports of issues (such as #5936 when using heap live size on Ruby 4.0).
We've previously added a workaround in #5938 but we're now seeing issues with many different kinds of objects, not just classes, and thus we're disabling this feature on Ruby 4.0 until we can root cause the issue and fix it.
Change log entry
Yes. Profiling: Disable live heap size profiling on Ruby 4 due to incompatibility
Additional Notes:
This is how the message looks in practice:
How to test the change?
I've included tests for this config change.