-
Notifications
You must be signed in to change notification settings - Fork 399
[PROF-13286] Disable heap profiling on Ruby 4 due to incompatibility #5148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
**What does this PR do?** This PR disables the heap profiling feature when running on Ruby 4 as the current implementation (that relies on object_id) is not safe to use on Ruby 4. **Motivation:** Avoid impacting applications running on Ruby 4. **Additional Notes:** Discussion with the Ruby core team in https://bugs.ruby-lang.org/issues/21710 has uncovered that our use of object_id from inside the NEWOBJ tracepoint is not safe on Ruby 4, and it's likely it can't be made safe. Until we're able to replace the Datadog profiler's usage of object_id for heap profiling, we won't be able to safely offer this feature on Ruby 4. (We temporarily disabled the heap profiler for 4.0.0-preview2 in #5091 and re-enabled it in #5121 when it looked fixed but discussion on the upstream ticket uncovered further issues) **How to test the change?** Validate that profiler doesn't enable heap profiling on Ruby 4.
|
Thank you for updating Change log entry section 👏 Visited at: 2025-12-16 00:05:54 UTC |
|
✅ Tests 🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage 🔗 Commit SHA: 4076741 | Docs | Datadog PR Page | Was this helpful? Give us feedback! |
…with Ruby 4 **What does this PR do?** This PR pairs with DataDog/dd-trace-rb#5148 on the Ruby profiler side to document that heap profiling is not currently compatible with Ruby 4. **Motivation:** Document this limitation clearly, to avoid confusing customers.
BenchmarksBenchmark execution time: 2025-12-15 18:08:31 Comparing candidate commit 4076741 in PR branch Found 1 performance improvements and 1 performance regressions! Performance is the same for 42 metrics, 2 unstable metrics. scenario:profiling - hold / resume
scenario:profiling - intern_all 1000 repeated strings
|
…with Ruby 4 (#33363) **What does this PR do?** This PR pairs with DataDog/dd-trace-rb#5148 on the Ruby profiler side to document that heap profiling is not currently compatible with Ruby 4. **Motivation:** Document this limitation clearly, to avoid confusing customers.
What does this PR do?
This PR disables the heap profiling feature when running on Ruby 4 as the current implementation (that relies on object_id) is not safe to use on Ruby 4.
Motivation:
Avoid impacting applications running on Ruby 4.
Change log entry
Yes. Disable heap profiling on Ruby 4 due to incompatibility
Additional Notes:
Discussion with the Ruby core team in https://bugs.ruby-lang.org/issues/21710 has uncovered that our use of object_id from inside the NEWOBJ tracepoint is not safe on Ruby 4, and it's likely it can't be made safe.
Until we're able to replace the Datadog profiler's usage of object_id for heap profiling, we won't be able to safely offer this feature on Ruby 4.
(We temporarily disabled the heap profiler for 4.0.0-preview2 in #5091 and re-enabled it in #5121 when it looked fixed but discussion on the upstream ticket uncovered further issues)
How to test the change?
Validate that profiler doesn't enable heap profiling on Ruby 4.