RFR: CODETOOLS-7903119: JOL: Experimental support for Lilliput [v2]

Aleksey Shipilev shade at openjdk.java.net
Tue Mar 8 10:17:54 UTC 2022


> Project Lilliput aims to reduce the size of the object header. JOL can support that project by detecting the Lilliput VM and printing out object internals more precisely. 
> 
> Sample output on JDK 19+:
> 
> 
> # Running 64-bit HotSpot VM.
> # Using compressed oop with 3-bit shift.
> # Using compressed klass with 3-bit shift.
> # Objects are 8 bytes aligned.
> #                       ref, bool, byte, char, shrt,  int,  flt,  lng,  dbl
> # Field sizes:            4,    1,    1,    2,    2,    4,    4,    8,    8
> # Array element sizes:    4,    1,    1,    2,    2,    4,    4,    8,    8
> # Array base offsets:    16,   16,   16,   16,   16,   16,   16,   16,   16
> 
> [B object internals:
> OFF  SZ   TYPE DESCRIPTION               VALUE
>   0   8        (object header: mark)     0x0000000000000001 (non-biasable; age: 0)
>   8   4        (object header: class)    0x00001ea0
>  12   4        (array length)            5
>  16   5   byte [B.<elements>             N/A
>  21   3        (object alignment gap)    
> Instance size: 24 bytes
> Space losses: 0 bytes internal + 3 bytes external = 3 bytes total
> 
> 
> Sample output on current Lilliput:
> 
> 
> # Running 64-bit HotSpot VM.
> # Lilliput VM detected (experimental).
> # Using compressed oop with 3-bit shift.
> # Using compressed klass with 3-bit shift.
> # Objects are 8 bytes aligned.
> #                       ref, bool, byte, char, shrt,  int,  flt,  lng,  dbl
> # Field sizes:            4,    1,    1,    2,    2,    4,    4,    8,    8
> # Array element sizes:    4,    1,    1,    2,    2,    4,    4,    8,    8
> # Array base offsets:    16,   16,   16,   16,   16,   16,   16,   16,   16
> 
> [B object internals:
> OFF  SZ   TYPE DESCRIPTION               VALUE
>   0   8        (object header: mark)     0x0000001200000001 (Lilliput)
>   8   4        (array length)            4
>  12   4        (alignment/padding gap)   
>  16   4   byte [B.<elements>             N/A
>  20   4        (object alignment gap)    
> Instance size: 24 bytes
> Space losses: 4 bytes internal + 4 bytes external = 8 bytes total
> 
> 
> Sample run on Lilliput + https://github.com/openjdk/lilliput/pull/41:
> 
> 
> # Running 64-bit HotSpot VM.
> # Lilliput VM detected (experimental).
> # Using compressed oop with 3-bit shift.
> # Using compressed klass with 3-bit shift.
> # Objects are 8 bytes aligned.
> #                       ref, bool, byte, char, shrt,  int,  flt,  lng,  dbl
> # Field sizes:            4,    1,    1,    2,    2,    4,    4,    8,    8
> # Array element sizes:    4,    1,    1,    2,    2,    4,    4,    8,    8
> # Array base offsets:    12,   12,   12,   12,   12,   12,   12,   16,   16
> 
> [B object internals:
> OFF  SZ   TYPE DESCRIPTION               VALUE
>   0   8        (object header: mark)     0x0000001200000001 (Lilliput)
>   8   4        (array length)            4
>  12   4   byte [B.<elements>             N/A
> Instance size: 16 bytes
> Space losses: 0 bytes internal + 0 bytes external = 0 bytes total

Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision:

  Much more reliable detection scheme

-------------

Changes:
  - all: https://git.openjdk.java.net/jol/pull/22/files
  - new: https://git.openjdk.java.net/jol/pull/22/files/b7fde914..0052a7b2

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jol&pr=22&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jol&pr=22&range=00-01

  Stats: 23 lines in 1 file changed: 13 ins; 2 del; 8 mod
  Patch: https://git.openjdk.java.net/jol/pull/22.diff
  Fetch: git fetch https://git.openjdk.java.net/jol pull/22/head:pull/22

PR: https://git.openjdk.java.net/jol/pull/22


More information about the jol-dev mailing list