From dc7a904a7facf540fde65f760b43d842b83a92d3 Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Wed, 11 Mar 2020 14:20:59 +0100 Subject: [PATCH 1/2] Limits system ram to 4GB OpenJDK assumes total system RAM of 128GB. Setting it to 4GB manually reduces the greediness of the JVM drastically. --- build.gradle | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build.gradle b/build.gradle index a59533eb727..e52c7d82e19 100644 --- a/build.gradle +++ b/build.gradle @@ -133,6 +133,10 @@ configure([project(':cli'), unixScriptFile.text = unixScriptFile.text.replace( 'cd "`dirname \\"$PRG\\"`/.." >/dev/null', 'cd "`dirname \\"$PRG\\"`" >/dev/null') + def script = file("${rootProject.projectDir}/bisq-$applicationName") + script.text = script.text.replace( + 'DEFAULT_JVM_OPTS=""', 'DEFAULT_JVM_OPTS="-XX:MaxRAM=4GB"') + if (osdetector.os != 'windows') delete fileTree(dir: rootProject.projectDir, include: 'bisq-*.bat') else From f127c28d1d887bd065d856598f3bf179382644e3 Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Wed, 11 Mar 2020 14:54:04 +0100 Subject: [PATCH 2/2] Limit for bisq-desktop only --- build.gradle | 8 +++++--- desktop/package/linux/package.sh | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index e52c7d82e19..ee527b2bb93 100644 --- a/build.gradle +++ b/build.gradle @@ -133,9 +133,11 @@ configure([project(':cli'), unixScriptFile.text = unixScriptFile.text.replace( 'cd "`dirname \\"$PRG\\"`/.." >/dev/null', 'cd "`dirname \\"$PRG\\"`" >/dev/null') - def script = file("${rootProject.projectDir}/bisq-$applicationName") - script.text = script.text.replace( - 'DEFAULT_JVM_OPTS=""', 'DEFAULT_JVM_OPTS="-XX:MaxRAM=4GB"') + if (applicationName == 'desktop') { + def script = file("${rootProject.projectDir}/bisq-$applicationName") + script.text = script.text.replace( + 'DEFAULT_JVM_OPTS=""', 'DEFAULT_JVM_OPTS="-XX:MaxRAM=4g"') + } if (osdetector.os != 'windows') delete fileTree(dir: rootProject.projectDir, include: 'bisq-*.bat') diff --git a/desktop/package/linux/package.sh b/desktop/package/linux/package.sh index 23bc2bb8f52..85bca2ac452 100755 --- a/desktop/package/linux/package.sh +++ b/desktop/package/linux/package.sh @@ -108,6 +108,7 @@ $JAVA_HOME/bin/javapackager \ -srcfiles desktop-$version-all.jar \ -appclass bisq.desktop.app.BisqAppMain \ -BjvmOptions=-Xss1280k \ + -BjvmOptions=-XX:MaxRAM=4g \ -BjvmOptions=-Djava.net.preferIPv4Stack=true \ -outfile Bisq-$version \ -v @@ -134,6 +135,7 @@ $JAVA_HOME/bin/javapackager \ -srcfiles desktop-$version-all.jar \ -appclass bisq.desktop.app.BisqAppMain \ -BjvmOptions=-Xss1280k \ + -BjvmOptions=-XX:MaxRAM=4g \ -BjvmOptions=-Djava.net.preferIPv4Stack=true \ -outfile Bisq-$version \ -v