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.

How to find which heap an object is in ?

Moderators: Vladimir Kondratyev, Anton Katilin

How to find which heap an object is in ?

Postby suaroman » Wed Mar 25, 2015 11:20 am

Hi Everyone,

I collected a memory snapshot of a particular jvm via the yjp agent.
When I review the dump (post mortem) via yourkit, I see Memory usage telemetry under the Memory tab. There I can see the various heaps such as PS Eden , PS Survivor , PS Old Gen, etc... If I hover over the Heap Memory graph, there's a breakdown of objects (in MB) that reside in each space. (e.g. Eden ,204 MB, PS Old Gen, 31MB, etc...).

How can I determine which objects are contained in what space ? For example, there is 31MB of allocated objects in Old Gen. How can I see what these objects are ?
suaroman
 
Posts: 1
Joined: Wed Mar 25, 2015 11:10 am

Re: How to find which heap an object is in ?

Postby Anton Katilin » Wed Mar 25, 2015 1:54 pm

Hi,

JVM does not provide means to explicitly identify the heap generation for a particular object. It gives only the generation sizes.

The heap generation is related with object age: older objects are promoted from Eden to the Old Gen during GC. This allows to use the following profiler features to estimate the object age instead:

- Generations (in the profiler's sense)
https://www.yourkit.com/docs/java/help/generations.jsp

- Object ages (requires allocation recording)
https://www.yourkit.com/docs/java/help/ages.jsp

Also, objects bigger than some particular size threshold are directly created in the Old Gen. So you may consider that all objects with big shallow size (normally, big arrays) are in the Old Gen. The following stackoverflow thread may be helpful: http://stackoverflow.com/questions/2461 ... generation

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


Return to Java Profiler

Who is online

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