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

Deprecate Object.finalize

    XMLWordPrintable

Details

    • b165

    Backports

      Description

        Finalizers are inherently problematic and their use can lead to performance issues,
        deadlocks, hangs, and other problematic behavior.

        Furthermore the timing of finalization is unpredictable with no guarantee that a finalizer will be called.
        Classes whose instances hold non-heap resources should provide a method
        to enable explicit release of those resources, and they should also implement
        java.lang.AutoCloseable if appropriate.

        The java.lang.ref.Cleaner and java.lang.ref.PhantomReference provide more flexible and
        efficient ways to release resources when an object becomes unreachable.

        Attachments

          Issue Links

            There are no Sub-Tasks for this issue.

            Activity

              People

                rriggs Roger Riggs
                rriggs Roger Riggs
                Votes:
                0 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: