title: Is it possible to get the object reference count?
body: <p>I'd like to know if there is a way to check how many references a Java object has. As far as I could check the only way to do that is using JVMTI through a JNI interface. Is there a pure Java (without using native libraries) solution to get this information?</p>
  <p>We are developing an educational tool for data structure animation(to be used with students implementation of certain algorithms), so it would be very nice if we could check for &quot;released&quot; objects on the most non-intrusive way (I'm trying to avoid forcing the user of this tool to call a method such as <code>objectReleased(objRef)</code> in order to update the data structure animation for an element removal or something similar).</p>