Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finalizer report does not show all objects available for finalization #26

Open
eclipsewebmaster opened this issue May 8, 2024 · 2 comments

Comments

@eclipsewebmaster
Copy link

| --- | --- |
| Bugzilla Link | 482964 |
| Status | NEW |
| Importance | P3 enhancement |
| Reported | Nov 25, 2015 01:03 EDT |
| Modified | Apr 09, 2020 13:37 EDT |
| Reporter | James Livingston |

Description

The Finalizer Overview shows objects being finalized and those queued for finalization, but it would be useful to also see objects that are not queued but would be if the JVM checked.

As a first approximation, all finalizable objects whose only incoming reference is from a Finalizer could be listed: in OQL "SELECT objects f.referent FROM java.lang.ref.Finalizer f where (inbounds(f.referent).size() = 1)"

@eclipsewebmaster
Copy link
Author

By Andrew Johnson on Jun 07, 2017 08:12

Would the retained set of all objects in the 'Ready for Finalizer Thread' query be interesting?
Those objects aren't reachable from ordinary threads, so might be eligible for finalization, though another finalizer could make them accessible before they go on the queue.

@eclipsewebmaster
Copy link
Author

By Andrew Johnson on Apr 09, 2020 13:37

Another approach for dumps from Oracle-based VMs is to use the Java Basics > References > Finalizer Reference Statistics query.

The 'Only Retained through Finalizer' shows all the objects only retained by finalizers, including finalizable objects on the finalizer queue and finalizable objects no longer directly reachable but which are not yet on the finalizer queue, plus all the other objects they retain.

For dumps from J9 based VMs it is a bit more complicated. In the latest snapshot builds the java.lang.Runtime object holds references via
to unfinalized objects. Select the objects, do merge shortest paths to GC roots excluding weak references, select merge to GC roots on class.
That will show the objects with finalizer still in use. The compare query can then be used to take a difference of the histogram of the originally selected objects and the results of the merge to GC roots on class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant