Unexpected Retained Size

Questions about YourKit Java Profiler
Post Reply
Thorsten Goetzke
Posts: 13
Joined: Mon Aug 27, 2012 8:58 am

Unexpected Retained Size

Post by Thorsten Goetzke »

Hello,

I took a memory-snapshot of our Application. The snapshot shows 6.000 Objects similar to the following Screenshot.
Image

So the "Retained Size" of a single "RemoteObjectBridgeImpl" seems to be 100k. But I don't get why.
The "Notifier" is shared among all Instances of "RemoteObjectBridgeImpl", so is the <class>.
Adding up the "Retained Size" of the remaining fields, I would expect the "Retained size" to be 2k at most.
Is this a bug or am i missing something?
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Unexpected Retained Size

Post by Anton Katilin »

Hello Thorsten,

To see which objects constitute the retained size please use Memory | Retained Objects (Shift+F4) action.
Adding up the "Retained Size" of the remaining fields
It's incorrect to add retained sizes of fields, or of any subset of individual objects. Instead, it's calculated for a set of objects as a whole:
http://www.yourkit.com/docs/java/help/sizes.jsp

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

Re: Unexpected Retained Size

Post by Anton Katilin »

An update: the same topic has been discussed in the following thread:
http://forums.yourkit.com/viewtopic.php?f=3&t=3104
Thorsten Goetzke
Posts: 13
Joined: Mon Aug 27, 2012 8:58 am

Re: Unexpected Retained Size

Post by Thorsten Goetzke »

Hello,

Thank you for helping. For future reference: A lot of big objects in our application are retained (or maybe i should say "are reachable" )
by two or more seperate fields of the same object, so they don't show show up in the retained size of of the respective fields.
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Unexpected Retained Size

Post by Anton Katilin »

Object explorer by itself may not be the best place to start finding biggest objects and investigate where objects are retained from. Instead, please consider the following:

Individual big objects can be found with the help of the "Biggest objects (dominators)" view:
http://www.yourkit.com/docs/java/help/b ... bjects.jsp

Also, sorting Class list by retained size (either estimated or calculated exact) can help finding both individual big objects or classes with big number of instances, whose total size is big.

Paths and Merged Paths views will help to find where they are retained from.
Post Reply