8343606: Test FinalizerTest.java intermittent fails Debuggee heap OOM#3188
8343606: Test FinalizerTest.java intermittent fails Debuggee heap OOM#3188sendaoYan wants to merge 2 commits into
Conversation
|
👋 Welcome back syan! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
|
This backport pull request has now been updated with issue from the original commit. |
|
|
Webrevs
|
|
Change has been verified locally by run the test on linux-x64. |
|
@sendaoYan This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply issue a |
|
Please describe what the patch does, and why it is important to fix this in a stable backport release. How often is intermittent? Have we seen this problem in jdk 11 ci/cd tests? |
I have updated the PR description.
I can reproduce this test intermittently fails or timed out by run this test 500 times on my local linux intel-8480 machine. It's clean backport, and test-fix only. I think this backport PR has no risk. The failure probability is about 30/1k on my local intel-8480 machine. The reproduce command line shows in JBS issue.
I think it's not. Maybe com/sun/jdi/FinalizerTest.java is not tier1 test. |
tstuefe
left a comment
There was a problem hiding this comment.
Ok.
Please make sure the GHAs run through.
|
@sendaoYan Please work with relevant OCA people to get your OCA status cleared (I don't know what changed 3 weeks ago). There is no way we can integrate anything before that happens. |
Hi all,
This is clean backport PR to fix the test bug which cause test run intermittent fails or intermittent timed out. Change include below:
Heap limit — Run the debuggee with -Xmx256M so OOM behavior is consistent on high-memory machines.
Memory cleanup — Call holdAlot.clear() before System.gc() in the allocation fallback path, so memory can be reclaimed before the second System.runFinalization().
Synchronization fix — Replace the finalizerRun boolean with a CountDownLatch so the main thread reliably waits for the low-priority finalizer thread to finish (a plain volatile flag was not enough).
Safer fallback loop — Use while (finalizerDone.getCount() > 0) instead of while (true) to avoid an infinite allocation loop when the race occurred.
Cleanup — Remove unused code, tidy imports, improve comments, and add a diagnostic message if the fallback path exits without triggering finalization.
The commit being backported was authored by SendaoYan on 28 Apr 2026 and was reviewed by Chris Plummer.
Thanks!
Progress
Error
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk11u-dev.git pull/3188/head:pull/3188$ git checkout pull/3188Update a local copy of the PR:
$ git checkout pull/3188$ git pull https://git.openjdk.org/jdk11u-dev.git pull/3188/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 3188View PR using the GUI difftool:
$ git pr show -t 3188Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk11u-dev/pull/3188.diff
Using Webrev
Link to Webrev Comment