What makes finalizers so expensive?

From efficient Java:

Oh, and one more thing: there is a serious assessment of the effectiveness of using finalizers. On my machine, the creation and destruction time of a simple object is 5.6 ns. Adding a finalizer increases the time to 2400 ns. In other words, it is about 430 times slower to create and destroy objects with finalizers.

What makes finalizers so expensive?

+5
source share
3 answers

http://www.ibm.com/developerworks/java/library/j-jtp01274/index.html

extract from the link above

(, finalize()) . , . JVM ( , JVM HotSpot) , . . , , ( ), , , . , , , . , , , , .

+5

, , . GC , , . , , , , , ..

GC: GC'ing : . , .

+5

, , , .

, , ( ) . , " " , , JVM .

100%, , , , ( - ).

0

All Articles