-
Notifications
You must be signed in to change notification settings - Fork 23
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
Allocation tracing #117
base: main
Are you sure you want to change the base?
Allocation tracing #117
Conversation
a64c0c0
to
e6259b5
Compare
This nearly survives compaction, but I think has one more rare-ish bug to work out (I had one failure in 100 runs).
So so keen! Gonna give it a whirl this weekend. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome! Played around with it a bit and everything's working as expected.
TODO: retained profiling mode should be built off of this functionality DONE!
This is a nice win as well.
Should we mention this in the README? Happy to do that in a follow-up.
} | ||
end | ||
|
||
GC.verify_compaction_references(toward: :empty, expand_heap: true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL, neat!
"#<#{self.class} #{elapsed_seconds} seconds, #{threads.count} threads, #{samples.count} samples, #{samples.uniq.size} unique>" | ||
"#<#{self.class} #{elapsed_seconds rescue "?"} seconds, #{threads.count} threads, #{samples.count} samples, #{samples.uniq.size} unique>" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this in case the result is inspected before the end time is set? Do we expect such a scenario considering a complete result is expected by the end of #stop
, or is it more so to make debugging easier?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I guess this also ensures CustomCollector#inspect
works out of the box.
# * Watching for freed objects | ||
# * Stopped | ||
# * Ignoring new objects | ||
# * Ignoring for freed objects |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# * Ignoring for freed objects | |
# * Ignoring freed objects |
@@ -1953,32 +1220,18 @@ Init_vernier(void) | |||
VALUE rb_mVernierMarkerPhase = rb_define_module_under(rb_mVernierMarker, "Phase"); | |||
rb_mVernierMarkerType = rb_define_module_under(rb_mVernierMarker, "Type"); | |||
|
|||
rb_cVernierResult = rb_define_class_under(rb_mVernier, "Result", rb_cObject); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is duped on line 1218.
I want to add the ability to trace and query allocation information about specific objects in the same way that
ObjectSpace.trace_object_allocations
works, except with full stack information.TODO: retained profiling mode should be built off of this functionalityDONE!