I would like to get a link to all objects in the Java heap, even if I don't have a link to these objects in my active thread. I don’t need objects without a link (those queued for garbage collection), but I would like to get everything that is still in use.
The goal is to serialize and store all objects in order to implement an unstable execution state. I understand that the rabbit hole goes deep when it comes to different types of transition state, but simply persisting objects and loaded class definitions would be useful for me.
Is there any way to access the heap for this to happen? Can I ignore a more direct approach?
source
share