Anonym
Anonym

Reputation: 7725

What is the difference between live objects and allocated objects in VisualVM?

As seen in the screenshot here, 0 live objects, 9 allocated objects.

What's the difference between a live and an allocated object?

jvisualvm screenshot

Upvotes: 21

Views: 6955

Answers (2)

Luciano Fiandesio
Luciano Fiandesio

Reputation: 10205

  • Allocated objects are all objects that have been created since application start (or reset)
  • Live objects are reachable objects that are being actively used by your program (likely still in the Young Generation)

Upvotes: 6

Vineet Reynolds
Vineet Reynolds

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

Related Questions