Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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-8667] Heap Profiling - Part 5 - Size #3333
[PROF-8667] Heap Profiling - Part 5 - Size #3333
Changes from 4 commits
d6e03c9
c6c4805
bd49938
4e29094
63c286e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
To be fair, the crashing path is only when an object is invalid -- all of the Ruby types are accounted for in
rb_obj_memsize_of(...)
so I'm not sure it's worth having this wrapper around it --rb_bug(...)
is a pretty big thing that the VM only uses when it truly believes there's something wrong at the VM/native level.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.
There's an extra "hidden"
rb_bug
call for theT_NODE
case which was the one that worried me a bit more. The fact that they userb_bug
in that place may be a hint that it should be impossible for us to accidentally track one. But I'm also not 100% sure if that's the case or if they just assumed whoever calledobj_memsize_of
would be doing that check first.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.
You're right -- I had missed that one. I don't know enough about RNode; intuitively if they're calling
rb_bug
it would be weird if we ever got handed one of those objects but I definitely see your concern.I guess it may worth leaving a bit more context as a comment on why we're doing this, but I'm convinced :)
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.
I soft-wonder if we'll run into trouble with
T_DATA
(or data/typeddata) objects, since the size for these is up to native extension authors. Since these methods don't get used very often, they may be buggy or inefficient. I guess... let's maybe keep an eye out on these ones?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.
Note to our future selves, a separate config for this gets introduced in #3360 .