java.lang.ref.Cleaner supports lightweight cleanup of object without using finalization. It is up to each class or library to create or share a Cleaner object.
It may be useful to have a common Cleaner to amortize the cost of the thread needed by the cleaner.
There is a risk to applications sharing a cleaner that a misbehaving cleaning function might delay or disrupt cleaning.
It may be useful to have a common Cleaner to amortize the cost of the thread needed by the cleaner.
There is a risk to applications sharing a cleaner that a misbehaving cleaning function might delay or disrupt cleaning.
- relates to
-
JDK-8138696 java.lang.ref.Cleaner - an alternative to finalization
-
- Resolved
-