-
Notifications
You must be signed in to change notification settings - Fork 76
Check if an object is in our heap before using VM map during counting live bytes #1289
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
Check if an object is in our heap before using VM map during counting live bytes #1289
Conversation
Even if the address is in the available range, its space index (Map64) or chunk index (Map32) may still map to a In my opinion, Note: If the performance of |
I changed Using |
FYI I wanted to mention that @steveblackburn wanted us to have the same mechanism for address lookup for all our spaces, i.e. VM space should not be special cased. We discussed this in a recent group meeting when I went through the issues I was facing in ART. So arguably this is a bit of a hack still. |
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.
LGTM
It is nice to have a unified mechanism to get the space index for any given address (or |
This PR fixes a bug in
increase_live_bytes
. If an object in the VM space is scanned, the method will be called with an object reference into the VM space, which may not be in our heap range. Then we get a space descriptor from the VM map, and we will see panics in the following code.mmtk-core/src/util/heap/layout/map64.rs
Line 209 in 129362d
mmtk-core/src/util/heap/layout/map32.rs
Line 258 in 129362d
This PR works around the problem by checking if the object is in our heap range first.