Withdrawn: CODETOOLS-7902866: JOL: Rework the instance dump output: formatting, decoding mark/class words, array length
Aleksey Shipilev
shade at openjdk.java.net
Mon Mar 29 13:27:39 UTC 2021
On Mon, 29 Mar 2021 13:17:19 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
> JOL already knows a lot about the target VM. It can also decode the object headers more verbosely.
>
> `JOLSample_14_FatLocking` example output:
>
> $ ~/Install/jdk11u-dev/bin/java -cp jol-samples/target/jol-samples.jar org.openjdk.jol.samples.JOLSample_14_FatLocking
> # WARNING: Unable to get Instrumentation. Dynamic Attach failed. You may add this JAR as -javaagent manually, or supply -Djdk.attach.allowAttachSelf
> # Running 64-bit HotSpot VM.
> # Using compressed oop with 3-bit shift.
> # Using compressed klass with 0x0000000800000000 base address and 0-bit shift.
> # Objects are 8 bytes aligned.
> # Field sizes by type: 4, 1, 1, 2, 2, 4, 4, 8, 8 [bytes]
> # Array element sizes: 4, 1, 1, 2, 2, 4, 4, 8, 8 [bytes]
>
> **** Fresh object
> org.openjdk.jol.samples.JOLSample_14_FatLocking$A object internals:
> OFF SZ TYPE DESCRIPTION VALUE
> 0 8 (object header: mark) 0x0000000000000005 (biasable; age: 0)
> 8 4 (object header: class) 0x000d5d08
> 12 4 (object alignment gap)
> Instance size: 16 bytes
> Space losses: 0 bytes internal + 4 bytes external = 4 bytes total
>
> **** Before the lock
> org.openjdk.jol.samples.JOLSample_14_FatLocking$A object internals:
> OFF SZ TYPE DESCRIPTION VALUE
> 0 8 (object header: mark) 0x00007f5eec70c005 (biased: 0x0000001fd7bb1c30; epoch: 0; age: 0)
> 8 4 (object header: class) 0x000d5d08
> 12 4 (object alignment gap)
> Instance size: 16 bytes
> Space losses: 0 bytes internal + 4 bytes external = 4 bytes total
>
> **** With the lock
> org.openjdk.jol.samples.JOLSample_14_FatLocking$A object internals:
> OFF SZ TYPE DESCRIPTION VALUE
> 0 8 (object header: mark) 0x00007f5e64008682 (fat lock: 0x00007f5e64008682)
> 8 4 (object header: class) 0x000d5d08
> 12 4 (object alignment gap)
> Instance size: 16 bytes
> Space losses: 0 bytes internal + 4 bytes external = 4 bytes total
>
> **** After the lock
> org.openjdk.jol.samples.JOLSample_14_FatLocking$A object internals:
> OFF SZ TYPE DESCRIPTION VALUE
> 0 8 (object header: mark) 0x00007f5e64008682 (fat lock: 0x00007f5e64008682)
> 8 4 (object header: class) 0x000d5d08
> 12 4 (object alignment gap)
> Instance size: 16 bytes
> Space losses: 0 bytes internal + 4 bytes external = 4 bytes total
>
> **** After System.gc()
> org.openjdk.jol.samples.JOLSample_14_FatLocking$A object internals:
> OFF SZ TYPE DESCRIPTION VALUE
> 0 8 (object header: mark) 0x0000000000000001 (non-biasable; age: 0)
> 8 4 (object header: class) 0x000d5d08
> 12 4 (object alignment gap)
> Instance size: 16 bytes
> Space losses: 0 bytes internal + 4 bytes external = 4 bytes total
This pull request has been closed without being integrated.
-------------
PR: https://git.openjdk.java.net/jol/pull/11
More information about the jol-dev
mailing list