ce queue thread will ever process any particular object on the queue. If there are a large num-
ber of these objects, processing that reference queue will be quite expensive. Like all indefin-
ite references, this example should still be used sparingly.
THE FINALIZER QUEUE
The finalizer queue is the reference queue used to process the Finalizer references when the ref-
erent is eligible for GC.
When performing heap dump analysis, it is often convenient to make sure that there are no ob-
jects on the finalizer queue: those objects are about to be freed anyway, so eliminating them from
the heap dump will make it easier to see what else is occurring in the heap. You can cause the fi-
nalizer queue to be processed by executing this command:
% jcmd process_id GC.run_finalization
To monitor the finalizer queue to see if it might be an issue for an application, look for its size
(which is updated in real time) on the VM Summary tab of jconsole . Scripts can gather that in-
formation by running this command:
% jmap -finalizerinfo process_id