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.

Tweaking retained size

Moderators: Vladimir Kondratyev, Anton Katilin

Tweaking retained size

Postby calavera » Mon Jan 25, 2016 2:17 pm

Hi,

Is it possible to influence how a retained size is calculated?

1. I'm analysing an object whose many properties have alternative paths to GC root so they are not included in retained size. The alternative path however leads through just one other object. Can I disable this alternative reference for the the purpose of calculation of more informative retained size?

2. In https://www.yourkit.com/docs/java/help/sizes.jsp there is an formulation that retained size represents the amount of memory that will be freed by the garbage collector when this object is collected. This is not exactly true because the calculation does not differ between hard and weak references. So even when the alternative path to GC root for an object leads via weak reference, the object is not counted to retained size although it would be freed if the primary reference is removed. Is it possible to modify this behavior?
calavera
 
Posts: 2
Joined: Mon Jan 25, 2016 1:55 pm

Re: Tweaking retained size

Postby Anton Katilin » Mon Jan 25, 2016 3:19 pm

Hi,

1. No, but you can analyze alternate paths to GC roots by excluding particular references:
https://www.yourkit.com/docs/java/help/paths.jsp

2. You can null non-strong references on snapshot loading by specifying the following properties in <profiler dir>/bin/ui.ini (for version 2015) or <user home>/.yjp/ui.ini (for the EAP):
Code: Select all
    -Dyjp.keep.weak.refs=false
    -Dyjp.keep.soft.refs=false
    -Dyjp.keep.finalizer.refs=false

Please note that you must manually delete <snapshot>.idom file after applying/changing these options and open the snapshot anew.
Anton Katilin
 
Posts: 5575
Joined: Wed Aug 11, 2004 8:37 am

Re: Tweaking retained size

Postby calavera » Mon Feb 22, 2016 12:47 pm

Thanks, ui.ini settings worked great and is extremely useful.
calavera
 
Posts: 2
Joined: Mon Jan 25, 2016 1:55 pm

Re: Tweaking retained size

Postby Anton Katilin » Mon Feb 22, 2016 3:39 pm

Thank you for the feedback.
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 12 guests