Is it possible to obtain all references to an object in Java.
What I need to check is if an object has removed all subscriptions for callbacks.
Thanks
this is not possible from within the JVM but you can create a heap dump by using jmap
from the jdk, then you can parse the dump file using jhat
and click through the references which were alive when the dump was taken.
checkout this blogpost from frank kieviet, where jmap and jhat are used to identify permgen leaks in tomcat: http://blogs.oracle.com/fkieviet/entry/how_to_fix_the_dreaded
and the jmap and jhat sites:
http://download.oracle.com/javase/6/docs/technotes/tools/share/jhat.html http://download.oracle.com/javase/6/docs/technotes/tools/share/jmap.html