how to find out the types of the surviving objects after a GC

Tony Guan guanxiaohua at gmail.com
Fri Nov 5 15:45:55 PDT 2010


Hi John,

Thanks!

I understand that the klassOop  maybe compressed, so I need to call
klass() for the proper access. But I am still wandering in the
klassOop definition, having no clue for getting the name of the java
class. While I think eventually I will get there, any hint is welcome
at any time!

Thanks again!

Tony (Xiaohua Guan)



On Fri, Nov 5, 2010 at 5:25 PM, John Cuthbertson
<john.cuthbertson at oracle.com> wrote:
> Hi Tony,
>
> The second word in each oop is the klassOop (a pointer to the structure
> describing the class/type). From that you can get the class name etc. For
> arrays the third word is the array length.
>
> Regards,
>
> JohnC
>
> On 11/05/10 12:11, Tony Guan wrote:
>>
>> Dear all,
>>
>> We are now interested in the types of the surviving objects after a
>> GC.  Currently, I plan to do like this:
>>
>> 1. record the top() address of the old generation before a minor GC.
>> 2. iterate oops in the increased portion(between the old top and the
>> new top) of the old generation
>> 3. for each oop, find out what's the type of the object it stands for.
>>
>> As I am studying the existing code from hotspot, I also realize that
>> this maybe a simple question for you:
>> Is there an easy way tell the types from the oop? Or will there be a
>> problem in my current plan?
>>
>> Thanks as always!
>>
>> Tony (Xiaohua Guan)
>>
>
>


More information about the hotspot-runtime-dev mailing list