~/talk

Finalizers - The not so good, the bad and the ugly

Talkat Devoxx US 2017 · 2017-03-21..03-23· [java]
links:none on file
slides:none on file

Shows measured harm: a JMH benchmark finds finalized objects cost about 3x allocation and force 50–200x GC time in tests, often requiring 2 GC cycles to reclaim due to resurrection. Demonstrates changing one hot class removed heavy finalize usage, reducing GC from about 5% of runtime to near zero in load tests and eliminating production restarts. Explains why finalize creates extra tracker objects, delays collection, can resurrect objects, swallows exceptions, and causes unpredictable, long-latency cleanup.

AI-written summary · about

  1. 0:00Work Day
  2. 0:10Analyzing Thread Dump
  3. 1:03What is Finalizer?
  4. 1:49Finalizable Object life Cycle
  5. 3:22Benchmark Results
  6. 5:54Load Test Result (Before)
  7. 6:18Load Test Result (After)
  8. 6:55Problem with Finalizers
  9. 7:14Dead Object Resurrection(Bad)
  10. 8:19Increase Allocation Cost(Bad)
  11. 9:04Cause more GCs(Ugly)
  12. 10:07No Guarantee, when called (Ugly)
  13. 10:45No Guarantee (Example)
  14. 11:49Make object concurrent(Ugly)
  15. 13:11Problem Class(Fixed)
  16. 14:08When to use Finalizer(Not so Good)
  17. 15:26Do you really need finalizer?
  18. 15:46Provide explicit termination method.
  19. 16:05Reduce data overhead(Before)
  20. 16:31Utilize Cache or Object pool
  21. 16:42References
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.