Currently I am working on a Java agent to assemble memory stats. With the help of the instrumentation API I can get a hold of the classes (and manipulate them). With plain J
From what I've been told in previous posts, there is no way to get a list of all the instances of a class in Java. The reflection API does some neat things but not this specific thing.
The best thing you can do is hold pointers to all objects but that seems obscene and doesn't work on other people's programs. Not ideal eh?