I was wondering if the way Java/JVM works means debugging tools like Eclipse can show me a list of all instances of a given class? I suppose one could write some reflection code but I don't want to break execution at the same place every time... rather I;d like to break execution and bring up a list of all MyClass123
objects in a debug window.
Is this even possible? Is it provided in Eclipse or any plugin?
Yes, it's possible in the standard eclipse debugger. See here. While debugging, right-click on a variable entry in the 'Variables View' and then click on 'All Instances':
This will open a list like this:
You may want to instatall Eclipse Test & Performance Tools Platform plugin in your application and perform MemoryAnalysis
. This gives you details around all different objects in memory and their references.
You will not need to put any breakpoint in the code. It will gather the required data on its own.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With