Fully featured low overhead profiler for Java EE and Java SE platforms.
Ultimate profiling and monitoring solution for Gradle, Maven, Ant, JUnit and TestNG.
Easy to use performance and memory profiler for .NET framework.

Retained sizes calculated incorrectly

Moderators: Vladimir Kondratyev, Anton Katilin

Retained sizes calculated incorrectly

Postby fitermay » Fri Jun 17, 2016 8:11 pm

Image

How can retained size of a container be less than the retained size of the contained object if it's the only strong reference to it?
fitermay
 
Posts: 3
Joined: Fri Jun 17, 2016 8:05 pm

Re: Retained sizes calculated incorrectly

Postby Anton Katilin » Sat Jun 18, 2016 7:09 am

Retained sizes are calculated with any references: strong, weak, soft.
If a container's retained size is less than the retained size of its content, this means that the container does not retain its content which is referenced from some other object via any kind of reference.
Anton Katilin
 
Posts: 5575
Joined: Wed Aug 11, 2004 8:37 am

Re: Retained sizes calculated incorrectly

Postby fitermay » Sat Jun 18, 2016 8:03 pm

Weak and soft references should be excluded when calculating retained sizes. Otherwise it is not a very useful metric.
fitermay
 
Posts: 3
Joined: Fri Jun 17, 2016 8:05 pm

Re: Retained sizes calculated incorrectly

Postby fitermay » Sat Jun 18, 2016 8:08 pm

Most certainly weak references never retain their contents. So they should absolutely be excluded during the calculation. Soft references MAY retain their contents, but the metric is more useful with them excluded or maybe two metrics should be provided with soft and without.
fitermay
 
Posts: 3
Joined: Fri Jun 17, 2016 8:05 pm

Re: Retained sizes calculated incorrectly

Postby Anton Katilin » Sat Jun 18, 2016 10:21 pm

To ignore soft and weak references please specify -Dyjp.keep.weak.refs=false and -Dyjp.keep.soft.refs=false in <user home>/.yjp/ui.ini
You'll need to delete *.snapshot.idom files before restarting the profiler UI to ensure the change is applied. The snapshot directory is <user home>/Snapshots
Anton Katilin
 
Posts: 5575
Joined: Wed Aug 11, 2004 8:37 am


Return to Java Profiler

Who is online

Users browsing this forum: Bing [Bot] and 8 guests