Skip to content
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

8325754: Dead AbstractQueuedSynchronizer$ConditionNodes survive minor garbage collections #735

Closed

Conversation

neethu-prasad
Copy link
Contributor

@neethu-prasad neethu-prasad commented Jun 17, 2024

Notes
Backport of JDK-8325754.

Unlink 'ConditionNode' before they are transferred to the sync queue as G1 seems to be able to collect “dead” ConditionNode instances during minor collections only if no formerly alive ConditionNode instances were promoted to the old generation and died there, which often cannot be avoided since e.g. on application startup many objects are promoted to the old generation after a few collections.

Verification

  • jdk_util, Tier 1 & Tier 2 tests passed.
  • Ran G1LoiteringConditionNodes.java (sample code from bug description) and verified that YG GC time is not increasing after full GC.

Before PR

dev-dsk-neethp-jdk-2c-ad54955c % /home/neethp/Development/jdk21u-dev/build/linux-x86_64-server-release/images/jdk/bin/java -Xms2048m -Xmx2048m -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:G1MaxNewSizePercent=20 '-Xlog:gc*,gc+age*=trace' -cp . G1LoiteringConditionNodes | grep -E 'Pause.*ms'                   
[0.949s][info ][gc          ] GC(0) Pause Young (Normal) (G1 Evacuation Pause) 103M->1M(2048M) 4.998ms
[2.550s][info ][gc          ] GC(1) Pause Young (Normal) (G1 Evacuation Pause) 154M->1M(2048M) 2.513ms
[6.963s][info ][gc          ] GC(2) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 3.213ms
[11.362s][info ][gc          ] GC(3) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.602ms
[15.737s][info ][gc          ] GC(4) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.654ms
[20.149s][info ][gc          ] GC(5) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.192ms
[24.570s][info ][gc          ] GC(6) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.210ms
[29.003s][info ][gc          ] GC(7) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.158ms
[33.432s][info ][gc          ] GC(8) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.839ms
[37.875s][info ][gc          ] GC(9) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.261ms
[42.306s][info ][gc          ] GC(10) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.131ms
[46.743s][info ][gc          ] GC(11) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.024ms
[51.184s][info ][gc          ] GC(12) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.231ms
[55.596s][info ][gc          ] GC(13) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.842ms
[60.036s][info ][gc          ] GC(14) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.144ms
[64.478s][info ][gc          ] GC(15) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 1.928ms
[68.911s][info ][gc          ] GC(16) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 1.894ms
[73.349s][info ][gc          ] GC(17) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 1.780ms
[77.782s][info ][gc          ] GC(18) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 1.916ms
[82.223s][info ][gc          ] GC(19) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.155ms
[86.651s][info ][gc          ] GC(20) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 1.879ms
[91.087s][info ][gc          ] GC(21) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.120ms
[95.522s][info ][gc          ] GC(22) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.138ms
[99.941s][info ][gc          ] GC(23) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.126ms
[104.378s][info ][gc          ] GC(24) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.006ms
[108.818s][info ][gc          ] GC(25) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.086ms
[113.253s][info ][gc          ] GC(26) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.155ms
[117.674s][info ][gc          ] GC(27) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.471ms
[120.087s][info ][gc             ] GC(28) Pause Full (System.gc()) 221M->1M(2048M) 41.492ms
[124.505s][info ][gc             ] GC(29) Pause Young (Normal) (G1 Evacuation Pause) 410M->1M(2048M) 3.656ms
[128.918s][info ][gc             ] GC(30) Pause Young (Normal) (G1 Evacuation Pause) 409M->2M(2048M) 4.031ms
[133.311s][info ][gc             ] GC(31) Pause Young (Normal) (G1 Evacuation Pause) 409M->2M(2048M) 4.073ms
[137.706s][info ][gc             ] GC(32) Pause Young (Normal) (G1 Evacuation Pause) 409M->3M(2048M) 4.930ms
[142.103s][info ][gc             ] GC(33) Pause Young (Normal) (G1 Evacuation Pause) 410M->3M(2048M) 5.014ms
[146.501s][info ][gc             ] GC(34) Pause Young (Normal) (G1 Evacuation Pause) 409M->4M(2048M) 4.530ms
[150.891s][info ][gc             ] GC(35) Pause Young (Normal) (G1 Evacuation Pause) 410M->4M(2048M) 5.750ms
[155.274s][info ][gc             ] GC(36) Pause Young (Normal) (G1 Evacuation Pause) 409M->4M(2048M) 5.644ms
[159.657s][info ][gc             ] GC(37) Pause Young (Normal) (G1 Evacuation Pause) 409M->5M(2048M) 5.842ms
[164.042s][info ][gc             ] GC(38) Pause Young (Normal) (G1 Evacuation Pause) 410M->5M(2048M) 5.948ms
[168.412s][info ][gc             ] GC(39) Pause Young (Normal) (G1 Evacuation Pause) 409M->6M(2048M) 6.093ms
[172.777s][info ][gc             ] GC(40) Pause Young (Normal) (G1 Evacuation Pause) 410M->6M(2048M) 6.434ms

After this change

dev-dsk-neethp-jdk-2c-ad54955c % /home/neethp/Development/jdk21u-dev/build/linux-x86_64-server-release/images/jdk/bin/java -Xms2048m -Xmx2048m -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:G1MaxNewSizePercent=20 '-Xlog:gc*,gc+age*=trace' -cp . G1LoiteringConditionNodes | grep -E 'Pause.*ms'                    
[0.954s][info ][gc          ] GC(0) Pause Young (Normal) (G1 Evacuation Pause) 103M->1M(2048M) 4.906ms
[2.552s][info ][gc          ] GC(1) Pause Young (Normal) (G1 Evacuation Pause) 154M->1M(2048M) 2.103ms
[6.967s][info ][gc          ] GC(2) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.472ms
[11.350s][info ][gc          ] GC(3) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.441ms
[15.728s][info ][gc          ] GC(4) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.479ms
[20.134s][info ][gc          ] GC(5) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.238ms
[24.554s][info ][gc          ] GC(6) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.242ms
[28.973s][info ][gc          ] GC(7) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.512ms
[33.402s][info ][gc          ] GC(8) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.101ms
[37.838s][info ][gc          ] GC(9) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.191ms
[42.264s][info ][gc          ] GC(10) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.122ms
[46.698s][info ][gc          ] GC(11) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.254ms
[51.147s][info ][gc          ] GC(12) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.323ms
[55.577s][info ][gc          ] GC(13) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.385ms
[60.015s][info ][gc          ] GC(14) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.286ms
[64.457s][info ][gc          ] GC(15) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.165ms
[68.900s][info ][gc          ] GC(16) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.696ms
[73.338s][info ][gc          ] GC(17) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 1.808ms
[77.776s][info ][gc          ] GC(18) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.127ms
[82.201s][info ][gc          ] GC(19) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 1.935ms
[86.637s][info ][gc          ] GC(20) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 1.885ms
[91.074s][info ][gc          ] GC(21) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.108ms
[95.507s][info ][gc          ] GC(22) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 1.956ms
[99.933s][info ][gc          ] GC(23) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 1.820ms
[104.365s][info ][gc          ] GC(24) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.260ms
[108.790s][info ][gc          ] GC(25) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 1.850ms
[113.220s][info ][gc          ] GC(26) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 1.993ms
[117.653s][info ][gc          ] GC(27) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.025ms
[120.099s][info ][gc             ] GC(28) Pause Full (System.gc()) 223M->1M(2048M) 51.761ms
[124.509s][info ][gc             ] GC(29) Pause Young (Normal) (G1 Evacuation Pause) 410M->1M(2048M) 1.862ms
[128.920s][info ][gc             ] GC(30) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.050ms
[133.320s][info ][gc             ] GC(31) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 1.914ms
[137.729s][info ][gc             ] GC(32) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.112ms
[142.139s][info ][gc             ] GC(33) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 1.903ms
[146.540s][info ][gc             ] GC(34) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 1.911ms
[150.938s][info ][gc             ] GC(35) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.168ms
[155.335s][info ][gc             ] GC(36) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.045ms
[159.735s][info ][gc             ] GC(37) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.068ms
[164.140s][info ][gc             ] GC(38) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.358ms
[168.551s][info ][gc             ] GC(39) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.233ms
[172.955s][info ][gc             ] GC(40) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.153ms
[177.355s][info ][gc             ] GC(41) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.276ms
[181.758s][info ][gc             ] GC(42) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 1.836ms
[186.163s][info ][gc             ] GC(43) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.350ms
[190.564s][info ][gc             ] GC(44) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.396ms
[194.966s][info ][gc             ] GC(45) Pause Young (Normal) (G1 Evacuation Pause) 409M->1M(2048M) 2.000ms

Progress

  • JDK-8325754 needs maintainer approval
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8325754: Dead AbstractQueuedSynchronizer$ConditionNodes survive minor garbage collections (Bug - P4 - Approved)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk21u-dev.git pull/735/head:pull/735
$ git checkout pull/735

Update a local copy of the PR:
$ git checkout pull/735
$ git pull https://git.openjdk.org/jdk21u-dev.git pull/735/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 735

View PR using the GUI difftool:
$ git pr show -t 735

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk21u-dev/pull/735.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 17, 2024

👋 Welcome back neethu-prasad! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Jun 17, 2024

@neethu-prasad 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:

8325754: Dead AbstractQueuedSynchronizer$ConditionNodes survive minor garbage collections

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 38 new commits pushed to the master branch:

  • c3693c2: 8327840: Automate javax/swing/border/Test4129681.java
  • 6a67861: 8318605: Enable parallelism in vmTestbase/nsk/stress/stack tests
  • a79db00: 8309685: Fix -Wconversion warnings in assembler and register code
  • 7e12de9: 8334332: TestIOException.java fails if run by root
  • 5c1282b: 8332936: Test vmTestbase/metaspace/gc/watermark_70_80/TestDescription.java fails with no GC's recorded
  • c0eb17c: 8331063: Some HttpClient tests don't report leaks
  • c959207: 8331999: BasicDirectoryModel/LoaderThreadCount.java frequently fails on Windows in CI
  • 4bb85fc: 8325083: jdk/incubator/vector/Double512VectorTests.java crashes in Assembler::vex_prefix_and_encode
  • 568bd67: 8330133: libj2pkcs11.so crashes on some pkcs#11 v3.0 libraries
  • 8148675: 8330819: C2 SuperWord: bad dominance after pre-loop limit adjustment with base that has CastLL after pre-loop
  • ... and 28 more: https://git.openjdk.org/jdk21u-dev/compare/ccfae880577ab5b071815de13474e8987b45c943...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot changed the title Backport 60cbf2925024b1c2253256688ae41741fff0a860 8325754: Dead AbstractQueuedSynchronizer$ConditionNodes survive minor garbage collections Jun 17, 2024
@openjdk
Copy link

openjdk bot commented Jun 17, 2024

This backport pull request has now been updated with issue from the original commit.

@neethu-prasad neethu-prasad marked this pull request as ready for review June 18, 2024 13:11
@openjdk
Copy link

openjdk bot commented Jun 18, 2024

⚠️ @neethu-prasad This change is now ready for you to apply for maintainer approval. This can be done directly in each associated issue or by using the /approval command.

@openjdk openjdk bot added the rfr Pull request is ready for review label Jun 18, 2024
@mlbridge
Copy link

mlbridge bot commented Jun 18, 2024

Webrevs

@neethu-prasad
Copy link
Contributor Author

neethu-prasad commented Jun 18, 2024

/approval request Backport to unlink 'ConditionNode' before they are transferred to the sync queue; applies cleanly; All tests passed; Risk is low: there are no follow-up bug since mainline integration 4 months ago. Also, similar change was made to LinkedBlockingQueue more than 10 years ago as part of JDK-6805775

@openjdk
Copy link

openjdk bot commented Jun 18, 2024

@neethu-prasad
8325754: The approval request has been created successfully.

@openjdk openjdk bot added approval ready Pull request is ready to be integrated and removed approval labels Jun 18, 2024
@neethu-prasad
Copy link
Contributor Author

Thanks for the review & approval.

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Jun 20, 2024
@openjdk
Copy link

openjdk bot commented Jun 20, 2024

@neethu-prasad
Your change (at version 4c0c1e4) is now ready to be sponsored by a Committer.

@RealCLanger
Copy link
Contributor

/sponsor

@openjdk
Copy link

openjdk bot commented Jun 24, 2024

Going to push as commit 241b054.
Since your change was applied there have been 55 commits pushed to the master branch:

  • 57824ed: 8321220: JFR: RecordedClass reports incorrect modifiers
  • 1c19bbd: 8317360: Missing null checks in JfrCheckpointManager and JfrStringPool initialization routines
  • 432144b: 8316211: Open source several manual applet tests
  • a045d78: 8283223: gc/stringdedup/TestStringDeduplicationFullGC.java#Parallel failed with "RuntimeException: String verification failed"
  • c77926c: 7022325: TEST_BUG: test/java/util/zip/ZipFile/ReadLongZipFileName.java leaks files if it fails
  • 62c30e6: 8333398: Uncomment the commented test in test/jdk/java/util/jar/JarFile/mrjar/MultiReleaseJarAPI.java
  • d2534fa: 8328110: Allow simultaneous use of PassFailJFrame with split UI and additional windows
  • 420c4b5: 8316389: Open source few AWT applet tests
  • 8094990: 8313674: (fc) java/nio/channels/FileChannel/BlockDeviceSize.java should test for more block devices
  • 2ed8a96: 8315576: compiler/codecache/CodeCacheFullCountTest.java fails after JDK-8314837
  • ... and 45 more: https://git.openjdk.org/jdk21u-dev/compare/ccfae880577ab5b071815de13474e8987b45c943...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jun 24, 2024
@openjdk openjdk bot closed this Jun 24, 2024
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Jun 24, 2024
@openjdk
Copy link

openjdk bot commented Jun 24, 2024

@RealCLanger @neethu-prasad Pushed as commit 241b054.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@neethu-prasad neethu-prasad deleted the Backport-JDK-8325754 branch June 24, 2024 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport clean integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

2 participants