JDK 18 | JDK 19 |
---|---|
18 b27Fixed | 19Fixed |
Blocks :
|
|
CSR :
|
JDK-8277305 :
|
|
JDK-8277365 :
|
|
JDK-8277502 :
|
|
JDK-8278574 :
|
|
JDK-8278575 :
|
JEP 421 proposes to deprecate finalization for removal. As part of that work, it proposes a command-line option to disable finalization, so that developers can evaluate the effect on applications of not having finalization prior to its removal. This enhancement request covers the option. The option would be as follows: --finalization=<value> Legal values are "enabled" and "disabled". The default value in this release will be "enabled". In a future release, the default value will change to "disabled". However, both values will be accepted in the current release. The option "--finalization=disabled" on the command line will disable finalization, and "--finalization=enabled" will do nothing, as finalization is enabled by default. Other values will cause an error. Additional valid values may be added in the future. The effect of disabling finalization is as follows: * When a class is loaded into the JVM, the detection of a non-trivial finalize() method in the class is disabled. This prevents creation of finalization-related data structures by various GCs. This also disables the upcall to Finalizer::register, which prevents finalization-eligible objects from ever appearing on the heap. FinalReference processing will therefore not be done, and objects' finalize() methods won't be called. * The finalizer thread is not created. * Calls to `System::runFinalization` and `Runtime::runFinalization` have no effect. The Java Platform Specification, the JLS, and the "java" tool reference page will be updated to document this option. See the CSR JDK-8276773 for details.
|