From shade at openjdk.java.net Tue Mar 8 09:45:30 2022 From: shade at openjdk.java.net (Aleksey Shipilev) Date: Tue, 8 Mar 2022 09:45:30 GMT Subject: RFR: CODETOOLS-7903119: JOL: Experimental support for Lilliput Message-ID: 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. 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. 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. N/A Instance size: 16 bytes Space losses: 0 bytes internal + 0 bytes external = 0 bytes total ------------- Commit messages: - Support Lilliput Changes: https://git.openjdk.java.net/jol/pull/22/files Webrev: https://webrevs.openjdk.java.net/?repo=jol&pr=22&range=00 Issue: https://bugs.openjdk.java.net/browse/CODETOOLS-7903119 Stats: 73 lines in 3 files changed: 66 ins; 0 del; 7 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 From shade at openjdk.java.net Tue Mar 8 10:17:54 2022 From: shade at openjdk.java.net (Aleksey Shipilev) Date: Tue, 8 Mar 2022 10:17:54 GMT Subject: RFR: CODETOOLS-7903119: JOL: Experimental support for Lilliput [v2] In-Reply-To: References: Message-ID: > 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. 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. 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. 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 From duke at openjdk.java.net Tue Mar 8 17:47:15 2022 From: duke at openjdk.java.net (duke) Date: Tue, 8 Mar 2022 17:47:15 GMT Subject: git: openjdk/jol: 7903119: JOL: Experimental support for Lilliput Message-ID: Changeset: affdda22 Author: Aleksey Shipil?v Committer: GitHub Date: 2022-03-08 18:45:28 +0000 URL: https://git.openjdk.java.net/jol/commit/affdda229185a73385155a7479f7e348e854558b 7903119: JOL: Experimental support for Lilliput ! jol-core/src/main/java/org/openjdk/jol/info/ClassLayout.java ! jol-core/src/main/java/org/openjdk/jol/vm/Experiments.java ! jol-core/src/main/java/org/openjdk/jol/vm/HotspotUnsafe.java From shade at openjdk.java.net Tue Mar 8 17:48:29 2022 From: shade at openjdk.java.net (Aleksey Shipilev) Date: Tue, 8 Mar 2022 17:48:29 GMT Subject: Withdrawn: CODETOOLS-7903119: JOL: Experimental support for Lilliput In-Reply-To: References: Message-ID: On Tue, 8 Mar 2022 09:40:18 GMT, Aleksey Shipilev wrote: > 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. 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. 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. N/A > Instance size: 16 bytes > Space losses: 0 bytes internal + 0 bytes external = 0 bytes total This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.java.net/jol/pull/22