-
Notifications
You must be signed in to change notification settings - Fork 377
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
[PROF-10987] Add Ruby GC guard to heap profiler as a preventative measure #4187
Conversation
…sure **What does this PR do?** This PR adds a `RUBY_GC_GUARD` call to the Ruby heap profiler, making sure that the object being pointed by the `ref` local variable does not get garbage collected too early. **Motivation:** This is a speculative fix: We've seen a crash coming from calls to `ruby_obj_memsize_of` (line 654). Adding this `RUBY_GC_GUARD` is a very-low-cost "just in case" until we can fully get to the bottom of this crash, and even if it wasn't needed, it's very harmless to have. **Additional Notes:** N/A **How to test the change?** This is part of the challenge -- it's extremely hard to test this change, as in many compilers it may even turn out to be a no-op. We'll need to wait for more info on the crash to go further than this change.
Datadog ReportBranch report: ✅ 0 Failed, 22036 Passed, 1459 Skipped, 5m 11.27s Total Time ⌛ Performance Regressions vs Default Branch (3)
|
BenchmarksBenchmark execution time: 2024-12-03 17:27:57 Comparing candidate commit a38bed3 in PR branch Found 1 performance improvements and 0 performance regressions! Performance is the same for 30 metrics, 2 unstable metrics. scenario:profiler - sample timeline=false
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4187 +/- ##
==========================================
- Coverage 97.75% 97.74% -0.01%
==========================================
Files 1357 1357
Lines 81890 81890
Branches 4164 4164
==========================================
- Hits 80054 80046 -8
- Misses 1836 1844 +8 ☔ View full report in Codecov by Sentry. |
What does this PR do?
This PR adds a
RUBY_GC_GUARD
call to the Ruby heap profiler, making sure that the object being pointed by theref
local variable does not get garbage collected too early.Motivation:
This is a speculative fix:
We've seen a crash coming from calls to
ruby_obj_memsize_of
(line 654). Adding thisRUBY_GC_GUARD
is a very-low-cost "just in case" until we can fully get to the bottom of this crash, and even if it wasn't needed, it's very harmless to have.Change log entry
(Internal change, not relevant for changelog)
Additional Notes:
N/A
How to test the change?
This is part of the challenge -- it's extremely hard to test this change, as in many compilers it may even turn out to be a no-op.
We'll need to wait for more info on the crash to go further than this change.