diff --git a/.github/workflows/dietpi-software.bash b/.github/workflows/dietpi-software.bash index ebfcf3b534..87e1880804 100644 --- a/.github/workflows/dietpi-software.bash +++ b/.github/workflows/dietpi-software.bash @@ -408,6 +408,9 @@ G_EXEC eval 'echo -e '\''[Service]\nAmbientCapabilities='\'' > rootfs/etc/system # Workaround for failing 32-bit ARM Rust builds on ext4 in QEMU emulated container on 64-bit host: https://github.com/rust-lang/cargo/issues/9545 (( $arch < 3 && $G_HW_ARCH > 9 )) && G_EXEC eval 'echo -e '\''tmpfs /mnt/dietpi_userdata tmpfs size=3G,noatime,lazytime\ntmpfs /root tmpfs size=3G,noatime,lazytime'\'' >> rootfs/etc/fstab' +# Workaround failing Java apps if 64-bit host memory leads to too large heap size in emulated 32-bit containers: https://stackoverflow.com/questions/4401396 +(( $arch < 3 && $G_HW_ARCH > 2)) && G_EXEC sed --follow-symlinks -i '/# Start DietPi-Software/a\sed -i '\''s|-mx${memory_limit}m|-mx1024m|'\'' /boot/dietpi/dietpi-software' rootfs/boot/dietpi/dietpi-login + # Workaround for Node.js on ARMv6 (( $arch == 1 )) && G_EXEC sed --follow-symlinks -i '/# Start DietPi-Software/a\sed -i '\''/G_EXEC chmod +x node-install.sh/a\\sed -i "/^ARCH=/c\\ARCH=armv6l" node-install.sh'\'' /boot/dietpi/dietpi-software' rootfs/boot/dietpi/dietpi-login diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 7dde7b6f16..4c5ec3d225 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -6194,7 +6194,7 @@ After=network-online.target remote-fs.target SyslogIdentifier=Airsonic User=airsonic WorkingDirectory=/mnt/dietpi_userdata/airsonic -ExecStart=/usr/bin/java -Xmx${memory_limit}m -Dairsonic.home=/mnt/dietpi_userdata/airsonic -Dserver.servlet.context-path=/airsonic -Dserver.port=8080 -jar /mnt/dietpi_userdata/airsonic/airsonic.war +ExecStart=/usr/bin/java -mx${memory_limit}m -Dairsonic.home=/mnt/dietpi_userdata/airsonic -Dserver.servlet.context-path=/airsonic -Dserver.port=8080 -jar /mnt/dietpi_userdata/airsonic/airsonic.war SuccessExitStatus=143 [Install] @@ -7476,7 +7476,7 @@ SyslogIdentifier=Ubooquity User=ubooquity LogsDirectory=ubooquity WorkingDirectory=/mnt/dietpi_userdata/ubooquity -ExecStart=/usr/bin/java -Xmx${memory_limit}m -jar /mnt/dietpi_userdata/ubooquity/Ubooquity.jar --headless --remoteadmin --adminport 2038 --libraryport 2039 +ExecStart=/usr/bin/java -mx${memory_limit}m -jar /mnt/dietpi_userdata/ubooquity/Ubooquity.jar --headless --remoteadmin --adminport 2038 --libraryport 2039 SuccessExitStatus=143 [Install] @@ -7538,7 +7538,7 @@ After=network-online.target remote-fs.target SyslogIdentifier=Komga User=komga WorkingDirectory=/mnt/dietpi_userdata/komga -ExecStart=/usr/bin/java -Xmx${memory_limit}m -jar komga.jar +ExecStart=/usr/bin/java -mx${memory_limit}m -jar komga.jar SuccessExitStatus=143 [Install] @@ -11543,7 +11543,7 @@ _EOF_ G_EXEC chown -R papermc:papermc /mnt/dietpi_userdata/papermc # Assure 1.5 GiB overall memory (-100 MiB to avoid tiny swap space) is available. - local heap_size='512' + local memory_limit=512 if (( $RAM_TOTAL < 1436 )) then G_DIETPI-NOTIFY 2 'Stable PaperMC operation requires at least 1.5 GiB system memory. We will now increase your swap size to satisfy this requirement.' @@ -11552,7 +11552,7 @@ _EOF_ # On 2 GiB+ physical RAM devices, apply 1 GiB heap size by default elif (( $RAM_PHYS > 1848 )) then - heap_size='1024' + memory_limit=1024 fi # Service @@ -11568,7 +11568,7 @@ SyslogIdentifier=PaperMC User=papermc LogsDirectory=papermc WorkingDirectory=/mnt/dietpi_userdata/papermc -ExecStart=/usr/bin/java -Xmx${heap_size}m -jar /opt/papermc/paperclip.jar --nogui --noconsole +ExecStart=/usr/bin/java -mx${memory_limit}m -jar /opt/papermc/paperclip.jar --nogui --noconsole SuccessExitStatus=143 [Install]