Repository navigation
Conversation
…dge processing During bridge processing we collect the set of bridge objects that are eligible for collection. We then build the graph of references between these objects, by going through dead objects. For nursery collections, it makes no sense to visit major objects, since these objects are logically alive during the current collection. Any bridge object that they will end up referencing would have been alive during this collection so visiting them doesn't make sense. I believe this scanning was accidental, likely meant to ensure that we visit the current set of bridge objects (which were previously promoted so they live now in the major heap). The problem with this scanning is not only a performance problem, but bridge processing will tag the vtable and store the `ScanData*` in the lock word. If we are doing this mutation for live objects, this can interfere with the scanning done by the concurrent mark (since it does an untagged access of the vtable to obtain the gc descriptor and other info), leading to random crashes.
|
Azure Pipelines: Successfully started running 3 pipeline(s). 12 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @BrzVlad |
Member
Author
|
This now matches the behavior that is used for the CoreCLR gc bridge. This can have significant perf impact for the gen0 pauses since we avoid redundantly scanning objects from the major heap. This fixes a bad interaction between gc bridge and concurrent collector. We have had plenty of reports that concurrent mark leads to random crashes on android and many users are using the serial collector as a workaround, which has longer pauses. It is still unclear to me whether we should backport it, I believe it would be good to have it readily available in case we do need to do it for a customer. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
During bridge processing we collect the set of bridge objects that are eligible for collection. We then build the graph of references between these objects, by going through dead objects. For nursery collections, it makes no sense to visit major objects, since these objects are logically alive during the current collection. Any bridge object that they will end up referencing would have been alive during this collection so visiting them doesn't make sense. I believe this scanning was accidental, likely meant to ensure that we visit the current set of bridge objects (which were previously promoted so they live now in the major heap).
The problem with this scanning is not only a performance problem, but bridge processing will tag the vtable and store the
ScanData*in the lock word. If we are doing this mutation for live objects, this can interfere with the scanning done by the concurrent mark (since it does an untagged access of the vtable to obtain the gc descriptor and other info), leading to random crashes.