Skip to content

Commit c95965b

Browse files
committed
[OPENJDK-4106] Enable compact object headers
Signed-off-by: Jonathan Dowland <[email protected]>
1 parent bd24058 commit c95965b

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

modules/jvm/artifacts/opt/jboss/container/java/jvm/java-default-options

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,14 @@ error_handling() {
8181
echo "-XX:+ExitOnOutOfMemoryError"
8282
}
8383

84-
## Echo options, trimming trailing and multiple spaces
85-
echo "$(max_memory) $(gc_config) $(diagnostics) $(error_handling)" | awk '$1=$1'
84+
# OPENJDK-4106
85+
maybe_compactObjectHeaders() {
86+
if [ "$JAVA_COMPACT_OBJECT_HEADERS" != "false" ]; then
87+
echo "-XX:+UseCompactObjectHeaders"
88+
fi
89+
}
90+
91+
echo "$(max_memory) $(gc_config) $(diagnostics) $(error_handling)\
92+
$(maybe_compactObjectHeaders)
93+
94+
" | awk '$1=$1' # trim leading/trailing spaces and squash multi

modules/jvm/module.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,6 @@ envs:
6161
- name: GC_CONTAINER_OPTIONS
6262
description: specify Java GC to use. The value of this variable should contain the necessary JRE command-line options to specify the required GC, which will override the default of `-:+UseParallelGC`.
6363
example: -XX:+UseG1GC
64+
- name: JAVA_COMPACT_OBJECT_HEADERS
65+
description: Whether to enable compact object headers (JEP519) for JDK24 and newer. Enabled by default.
66+
example: "false"

0 commit comments

Comments
 (0)