RFR: 8261759: ZGC: ZWorker Threads Continue Marking After System.exit() called

Per Liden pliden at openjdk.java.net
Tue Apr 13 07:11:24 UTC 2021


During JVM termination, ZCollectedHeap::stop() currently only returns once any ongoing GC cycle has completed. However, waiting for a GC cycle to complete can take awhile, so the JVM might not terminate as promptly as one might expect.

This patch adds abortion checks to workers doing marking and relocation to allow ZWorker threads to terminate promptly. In addition, before and after concurrent phases, the ZDriver thread checks if `should_terminate()` is true and prematurely terminates the GC cycle if that's the case.

Testing:
 * Tier1-7 on Linux.
 * SPECjbb2015, comparing score and marking times against baseline (5 iterations each), no difference observed.
 * Ad-hoc programs calling System.exit() during marking/relocation.
 * Manual Ctrl-C testing.

-------------

Commit messages:
 - 8261759: ZGC: ZWorker Threads Continue Marking After System.exit() called

Changes: https://git.openjdk.java.net/jdk/pull/3453/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=3453&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8261759
  Stats: 150 lines in 7 files changed: 141 ins; 0 del; 9 mod
  Patch: https://git.openjdk.java.net/jdk/pull/3453.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/3453/head:pull/3453

PR: https://git.openjdk.java.net/jdk/pull/3453



More information about the hotspot-gc-dev mailing list