Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8320335

Deprecate `RegisterFinalizersAtInit` option and code

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 22
    • 22
    • hotspot
    • b26

      The `RegisterFinalizersAtInit` option controls whether finalizers are registered after allocation or at return from the Object.<init> constructor. The default is to register at the end of Object.<init> and this has been the default for years.

      We should remove the option and hardcode it always be true so finalizers can only be registered at the end of Object.<init>.

      Continuing to support the flag is counter to the increased Integrity push [0] and will be increasingly problematic when Project Valhalla merges in due to allowing larval objects to escape before they are frozen.


      [0] https://openjdk.org/jeps/8305968

            heidinga Dan Heidinga
            heidinga Dan Heidinga
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: