Subject: [PATCH] #23837: Investigate setting `-XX:MaxRAMPercentage` to >25% of system memory
---
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/native/linux/latest/etc/default/josm-latest b/native/linux/latest/etc/default/josm-latest
a
|
b
|
|
2 | 2 | # Uncomment the JAVA_OPTS lines to enable their use by /usr/bin/josm-latest |
3 | 3 | |
4 | 4 | # Increase usable memory |
5 | | #JAVA_OPTS="-Xmx2048m ${JAVA_OPTS}" |
| 5 | #JAVA_OPTS="-XX:MaxRAMPercentage=75.0 -Xms256m ${JAVA_OPTS}" |
6 | 6 | |
7 | 7 | # Enable OpenGL pipeline (2D graphic accelerators) |
8 | 8 | #JAVA_OPTS="-Dsun.java2d.opengl=True ${JAVA_OPTS}" |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/native/linux/latest/usr/bin/josm-latest b/native/linux/latest/usr/bin/josm-latest
a
|
b
|
|
57 | 57 | . "/etc/default/${JOSM_VERSION}" |
58 | 58 | fi |
59 | 59 | |
| 60 | # If there is more than 8G ram, we can use up to 75% of the memory while still leaving 2G for other things. |
| 61 | if [ "$(free --mega | grep '^Mem:' | awk '{print $2}')" -gt 8192 ]; then |
| 62 | # But don't set anything if JAVA_OPTS is already set. |
| 63 | JAVA_OPTS="${JAVA_OPTS:=-XX:MaxRAMPercentage=75.0 -Xms256m}" |
| 64 | fi |
| 65 | |
60 | 66 | JAVA_OPTS="-Djosm.restart=true -Djosm.dir.name=JOSM-latest -Djava.net.useSystemProxies=true $JAVA_OPTS" |
61 | 67 | |
62 | 68 | if [ -z "${JAVACMD}" ] && [ -n "${ALTERNATIVE_JDK}" ]; then |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/native/linux/tested/etc/default/josm b/native/linux/tested/etc/default/josm
a
|
b
|
|
2 | 2 | # Uncomment the JAVA_OPTS lines to enable their use by /usr/bin/josm |
3 | 3 | |
4 | 4 | # Increase usable memory |
5 | | #JAVA_OPTS="-Xmx2048m ${JAVA_OPTS}" |
| 5 | #JAVA_OPTS="-XX:MaxRAMPercentage=75.0 -Xms256m ${JAVA_OPTS}" |
6 | 6 | |
7 | 7 | # Enable OpenGL pipeline (2D graphic accelerators) |
8 | 8 | #JAVA_OPTS="-Dsun.java2d.opengl=True ${JAVA_OPTS}" |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/native/linux/tested/usr/bin/josm b/native/linux/tested/usr/bin/josm
a
|
b
|
|
57 | 57 | . "/etc/default/${JOSM_VERSION}" |
58 | 58 | fi |
59 | 59 | |
| 60 | # If there is more than 8G ram, we can use up to 75% of the memory while still leaving 2G for other things. |
| 61 | if [ "$(free --mega | grep '^Mem:' | awk '{print $2}')" -gt 8192 ]; then |
| 62 | # But don't set anything if JAVA_OPTS is already set. |
| 63 | JAVA_OPTS="${JAVA_OPTS:=-XX:MaxRAMPercentage=75.0 -Xms256m}" |
| 64 | fi |
| 65 | |
60 | 66 | JAVA_OPTS="-Djosm.restart=true -Djava.net.useSystemProxies=true $JAVA_OPTS" |
61 | 67 | |
62 | 68 | if [ -z "${JAVACMD}" ] && [ -n "${ALTERNATIVE_JDK}" ]; then |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/native/macosx/macos-jpackage.sh b/native/macosx/macos-jpackage.sh
a
|
b
|
|
59 | 59 | "${JAVA_HOME}/bin/jpackage" $JPACKAGEOPTIONS -n "JOSM" --input dist --main-jar josm-custom.jar \ |
60 | 60 | --main-class org.openstreetmap.josm.gui.MainApplication \ |
61 | 61 | --icon ./native/macosx/JOSM.icns --type app-image --dest app \ |
| 62 | --java-options "-XX:MaxRAMPercentage=75.0" \ |
| 63 | --java-options "-Xms256m" \ |
62 | 64 | --java-options "--add-modules java.scripting,java.sql,javafx.controls,javafx.media,javafx.swing,javafx.web" \ |
63 | 65 | --java-options "--add-exports=java.base/sun.security.action=ALL-UNNAMED" \ |
64 | 66 | --java-options "--add-exports=java.desktop/com.apple.eawt=ALL-UNNAMED" \ |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/native/windows/win-jpackage.sh b/native/windows/win-jpackage.sh
a
|
b
|
|
51 | 51 | jpackage $JPACKAGEOPTIONS -n "JOSM" --input dist --main-jar josm-custom.jar \ |
52 | 52 | --main-class org.openstreetmap.josm.gui.MainApplication \ |
53 | 53 | --icon ./native/windows/logo.ico --type $type --dest app \ |
| 54 | --java-options "-XX:MaxRAMPercentage=75.0" \ |
| 55 | --java-options "-Xms256m" \ |
54 | 56 | --java-options "--add-modules java.scripting,java.sql,javafx.controls,javafx.media,javafx.swing,javafx.web" \ |
55 | 57 | --java-options "--add-exports=java.base/sun.security.action=ALL-UNNAMED" \ |
56 | 58 | --java-options "--add-exports=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED" \ |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/native/josm.jnlp b/native/josm.jnlp
a
|
b
|
|
20 | 20 | <all-permissions/> |
21 | 21 | </security> |
22 | 22 | <resources> |
23 | | <java version="11+" vendor="Azul" java-vm-args="--add-modules=java.scripting,java.sql,javafx.controls,javafx.media,javafx.swing,javafx.web --add-exports=java.base/sun.security.action=ALL-UNNAMED --add-exports=java.desktop/com.apple.eawt=ALL-UNNAMED --add-exports=java.desktop/com.sun.imageio.spi=ALL-UNNAMED --add-exports=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED --add-exports=javafx.graphics/com.sun.javafx.application=ALL-UNNAMED --add-exports=jdk.deploy/com.sun.deploy.config=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/jdk.internal.loader=ALL-UNNAMED --add-opens=java.base/jdk.internal.ref=ALL-UNNAMED --add-opens=java.desktop/javax.imageio.spi=ALL-UNNAMED --add-opens=java.desktop/javax.swing.text.html=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED"/> |
| 23 | <java version="11+" vendor="Azul" java-vm-args="-XX:MaxRAMPercentage=75.0 -Xms256m --add-modules=java.scripting,java.sql,javafx.controls,javafx.media,javafx.swing,javafx.web --add-exports=java.base/sun.security.action=ALL-UNNAMED --add-exports=java.desktop/com.apple.eawt=ALL-UNNAMED --add-exports=java.desktop/com.sun.imageio.spi=ALL-UNNAMED --add-exports=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED --add-exports=javafx.graphics/com.sun.javafx.application=ALL-UNNAMED --add-exports=jdk.deploy/com.sun.deploy.config=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/jdk.internal.loader=ALL-UNNAMED --add-opens=java.base/jdk.internal.ref=ALL-UNNAMED --add-opens=java.desktop/javax.imageio.spi=ALL-UNNAMED --add-opens=java.desktop/javax.swing.text.html=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED"/> |
24 | 24 | <jar href="josm-tested.jar"/> |
25 | 25 | <!-- This was removed from josm-latest.jnlp on 2024-06-17. Remove if nothing gets reported. --> |
26 | 26 | <property name="java.util.Arrays.useLegacyMergeSort" value="true"/> |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/native/josm-latest.jnlp b/native/josm-latest.jnlp
a
|
b
|
|
20 | 20 | <all-permissions/> |
21 | 21 | </security> |
22 | 22 | <resources> |
23 | | <java version="11+" vendor="Azul" java-vm-args="--add-modules=java.scripting,java.sql,javafx.controls,javafx.media,javafx.swing,javafx.web --add-exports=java.base/sun.security.action=ALL-UNNAMED --add-exports=java.desktop/com.apple.eawt=ALL-UNNAMED --add-exports=java.desktop/com.sun.imageio.spi=ALL-UNNAMED --add-exports=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED --add-exports=javafx.graphics/com.sun.javafx.application=ALL-UNNAMED --add-exports=jdk.deploy/com.sun.deploy.config=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/jdk.internal.loader=ALL-UNNAMED --add-opens=java.base/jdk.internal.ref=ALL-UNNAMED --add-opens=java.desktop/javax.imageio.spi=ALL-UNNAMED --add-opens=java.desktop/javax.swing.text.html=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED"/> |
| 23 | <java version="11+" vendor="Azul" java-vm-args="-XX:MaxRAMPercentage=75.0 -Xms256m --add-modules=java.scripting,java.sql,javafx.controls,javafx.media,javafx.swing,javafx.web --add-exports=java.base/sun.security.action=ALL-UNNAMED --add-exports=java.desktop/com.apple.eawt=ALL-UNNAMED --add-exports=java.desktop/com.sun.imageio.spi=ALL-UNNAMED --add-exports=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED --add-exports=javafx.graphics/com.sun.javafx.application=ALL-UNNAMED --add-exports=jdk.deploy/com.sun.deploy.config=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/jdk.internal.loader=ALL-UNNAMED --add-opens=java.base/jdk.internal.ref=ALL-UNNAMED --add-opens=java.desktop/javax.imageio.spi=ALL-UNNAMED --add-opens=java.desktop/javax.swing.text.html=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED"/> |
24 | 24 | <jar href="josm-latest.jar"/> |
25 | 25 | </resources> |
26 | 26 | <application-desc main-class="org.openstreetmap.josm.gui.MainApplication"/> |