javajava-8jvm-hotspotjava-opts

How to interpret the output of -XX:CompileCommand="print Class::Method" in java


Here is an excerpt of the output that I get when I run the following command (40 is just an arg to the Fibonacci program) :

java -XX:+UnlockDiagnosticVMOptions -XX:CompileCommand="print Fibonacci::fibonacci" Fibonacci 40

Can someone explain the meanings of each data (I presume it means the number of bytes, e.g., main code takes 288 bytes). Also what do the various categories mean - relocation, stubs code, metadata, scopes data, scopes pcs, handler table etc mean ?

...
Compiled method (c2)      93   16       4       Fibonacci::fibonacci (22 bytes)
total in heap  [0xfff8000108113dd0,0xfff8000108114440] = 1648
relocation     [0xfff8000108113f00,0xfff8000108113f48] = 72
main code      [0xfff8000108113f60,0xfff8000108114080] = 288
stub code      [0xfff8000108114080,0xfff80001081141e0] = 352
oops           [0xfff80001081141e0,0xfff80001081141e8] = 8
metadata       [0xfff80001081141e8,0xfff8000108114210] = 40
scopes data    [0xfff8000108114210,0xfff8000108114298] = 136
scopes pcs     [0xfff8000108114298,0xfff80001081143d8] = 320
dependencies   [0xfff80001081143d8,0xfff80001081143e0] = 8
handler table  [0xfff80001081143e0,0xfff8000108114440] = 96
----------------------------------------------------------------------
Fibonacci.fibonacci  [0xfff8000108113f60, 0xfff80001081141e0]  640 bytes
[Entry Point]
[Verified Entry Point]
[Constants]
# {method} {0xfff80001036243b8} 'fibonacci' '(I)J' in 'Fibonacci'
# parm0:    I0        = int
#           [sp+0x90]  (sp of caller)
...

Solution

  • The hexadecimal numbers between square brackets are the start and end of the memory range that contain the data. As you guessed, the number after the = is the size of the data in bytes.

    Regarding the categories: