Bryan Pendleton wrote:
Is there any tooling builtin to the JVM to show reference chains, so I
can see at shutdown who is holding onto the generated plan?
Perhaps this can help? https://hat.dev.java.net/doc/README.html
bryan
It depends on which jvm you are using. The tool referenced above, HAT (Heap
Analysis Tool), is now obsolete, although you might be able to get the
information you need from it. You can create a binary heap dump using hprof
(included in JDK1.5, see
http://java.sun.com/developer/technicalArticles/Programming/HPROF.html) and
browse it using HAT or jhat (included with Mustang/JDK1.6).
Mustang also includes numerous other great improvements in this regard. You
may want to check out the OQL (Object Query Language):
http://blogs.sun.com/roller/page/sundararajan?entry=querying_java_heap_with_oql
Snmipped example:
Show referents that are not referred by another object. i.e., the referent is
reachable only by that soft reference:
select f.referent from java.lang.ref.SoftReference f
where f.referent != null && referrers(f.referent).length == 1
Hope it helps...
--
John