Retained size of objects > 100%

Questions about YourKit Java Profiler
Post Reply
jocko
Posts: 1
Joined: Thu Feb 13, 2020 9:24 am

Retained size of objects > 100%

Post by jocko »

I've memory profiled a Tomcat web application and I get a strange result, the retained size of memory used by the different packages comes to more than 100% (74% + 44% + 30%...). How can this be?

Image
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Retained size of objects > 100%

Post by Anton Katilin »

Retained size of different objects or object sets, unlike shallow size, must never be summed directly. This is because retained sets of different object sets (of different packages in your example) may intersect, i.e. include same objects, and if you try to directly sum retained sizes such objects will be accounted more than once, which is incorrect.

To see retained size of multiple packages select them (the table supports multiselection) then use Quick info (Ctrl+Q).

Please read more at https://www.yourkit.com/docs/java/help/sizes.jsp
Post Reply