简体   繁体   中英

jvisualvm difference between live objects and allocated objects

As seen in the screenshot here, 0 live objects, 9 allocated objects. What's the difference between a live and an allocated object ?

jvisualvm截图

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.

  • 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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM