RFR: JDK-8276422 Add command-line option to disable finalization

Stuart Marks smarks at openjdk.java.net
Thu Nov 18 01:51:07 UTC 2021


Pretty much what it says. The new option controls a static member in InstanceKlass that's consulted to determine whether the finalization machinery is activated for instances when a class is loaded. A new native method is added so that this state can be queried from Java. This is used to control whether a finalizer thread is created and to disable the `System` and `Runtime::runFinalization` methods. Includes tests for the above.

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

Commit messages:
 - extraneous newline
 - Merge branch 'master' into JDK-8276422-disable-finalization-option
 - Simplify InvalidFinalizationOption test.
 - Change InvalidFinalizationOption test to driver mode.
 - Revert extraneous whitespace change to globals.hpp.
 - Renaming within the test class itself.
 - Rename invalid finalization option test.
 - Add test for invalid finalization option syntax or value.
 - Add @bug line to JFR finalization event test.
 - Test that no jdk.FinalizationStatistics events are generated when finalization is disabled
 - ... and 7 more: https://git.openjdk.java.net/jdk/compare/29e552c0...3836cc94

Changes: https://git.openjdk.java.net/jdk/pull/6442/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=6442&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8276422
  Stats: 266 lines in 13 files changed: 249 ins; 0 del; 17 mod
  Patch: https://git.openjdk.java.net/jdk/pull/6442.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/6442/head:pull/6442

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


More information about the core-libs-dev mailing list