Bin's Tech Cabin
Bin's Tech Cabin
Jun 17, 2024 · Fundamentals

How Does Java’s FinalReference Keep Objects Alive During GC?

This article explains how the JVM creates and manages FinalReference objects, how they interact with the finalize() method, and how the ZGC and other GC phases discover, revive, and eventually reclaim objects, detailing the roles of ReferenceHandler, FinalizerThread, and related internal data structures.

FinalReferenceFinalizerThreadGarbage Collection
0 likes · 20 min read
How Does Java’s FinalReference Keep Objects Alive During GC?
iQIYI Technical Product Team
iQIYI Technical Product Team
Jul 14, 2023 · Backend Development

Investigation and Optimization of Long GC Pauses Caused by Excessive FinalReference in Spring Cloud Gateway

The team discovered that frequent Logback file rotations created thousands of FileOutputStream objects whose finalize‑based FinalReference instances flooded the G1GC reference‑processing phase, causing 13‑second pauses, and resolved the issue by enabling parallel reference processing, enlarging log rotation size, and adjusting GC initiation thresholds.

FinalReferenceGC pauseJVM
0 likes · 13 min read
Investigation and Optimization of Long GC Pauses Caused by Excessive FinalReference in Spring Cloud Gateway