I'd like to get all the active instantiations (i.e. objects not available for garbage collection) of a class (doesn't have to include subclasses). I can track it inside my own code; but I'm wondering, if I can ask the JVM for this information? Thanks.
Asked
Active
Viewed 34 times
0
-
Note that if you are tracking this in your own (application) code, there is a good chance that you will either run into memory leak problems, or performance problems. Especially if you need to track large numbers of these objects. This is simply an "requirement" you want to avoid rather than solve; i.e. find a way to not have to track them ... – Stephen C Nov 05 '21 at 00:03