Reputation: 7725
As seen in the screenshot here, 0 live objects, 9 allocated objects.
What's the difference between a live and an allocated object?
Upvotes: 21
Views: 6955
Reputation: 10205
Upvotes: 6
Reputation: 76709
The number of allocated objects is not the number of objects not yet reclaimed by the garbage collector. Rather, it is the number of objects created since application start, or since a reset of the "Collected Results Buffer" in VisualVM (there is a button in the memory profiler view to reset the collected results buffer).
The live objects are those objects that haven't been reclaimed by the garbage collector; this may include objects that are unreachable, and will definitely include objects that are still in use by the application.
Upvotes: 14