Retained sizes calculated incorrectly
-
- Posts: 3
- Joined: Fri Jun 17, 2016 8:05 pm
Retained sizes calculated incorrectly
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?
-
- Posts: 6172
- Joined: Wed Aug 11, 2004 8:37 am
Re: Retained sizes calculated incorrectly
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.
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.
-
- Posts: 3
- Joined: Fri Jun 17, 2016 8:05 pm
Re: Retained sizes calculated incorrectly
Weak and soft references should be excluded when calculating retained sizes. Otherwise it is not a very useful metric.
-
- Posts: 3
- Joined: Fri Jun 17, 2016 8:05 pm
Re: Retained sizes calculated incorrectly
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.
-
- Posts: 6172
- Joined: Wed Aug 11, 2004 8:37 am
Re: Retained sizes calculated incorrectly
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
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