-
Notifications
You must be signed in to change notification settings - Fork 5.8k
8275329: ZGC: vmTestbase/gc/gctests/SoftReference/soft004/soft004.java fails with assert(_phases->length() <= 1000) failed: Too many recored phases? #6358
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
Conversation
…a fails with assert(_phases->length() <= 1000) failed: Too many recored phases?
👋 Welcome back pliden! A progress list of the required criteria for merging this PR into |
@pliden This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 2 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
Thanks for reviewing! /integrate |
Going to push as commit 6b833db.
Your commit was automatically rebased without conflicts. |
In ZGC, the phases the "Pause Mark End" and "Concurrent Mark Continue" can be executed multiple times in the same GC cycle. This can happen for two reasons:
After "Concurrent Mark Continue" has terminated, but before "Pause Mark End" has started, a
SoftReference
or aWeakReference
is resurrected by a call toReference.get()
from a Java thread.A Java thread "hides" work from the GC worker threads doing marking, by detaching unmarked objects from the graph and push it to a thread local mark stack, that the GC needs to flush out. An example of this is when a Java thread continuously removes the first element in a single linked list that hasn't been marked yet.
The above events are typically rare, but it is possible to write a program that causes the above GC phases to be executed a large number of times. The test that failed (
soft004.java
) runs into case 2 above, where it has ~50,000,000 SoftReferences in the reference processing pending list (a single linked list) and continuously removes the first element until the list if empty. This causes more than 1000 "Pause Mark End" attempt to happen. For that reason, we don't wantTimePartitions
to assert if there are more than 1000 phases. This patch disables the assert in question if ZGC is used. An alternative would be to remove the assert completely, but @stefank preferred to just disable it for ZGC.Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/6358/head:pull/6358
$ git checkout pull/6358
Update a local copy of the PR:
$ git checkout pull/6358
$ git pull https://git.openjdk.java.net/jdk pull/6358/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 6358
View PR using the GUI difftool:
$ git pr show -t 6358
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/6358.diff