Skip to content

Commit

Permalink
v9.10
Browse files Browse the repository at this point in the history
- DietPi-Software | Java heap size limits are not Xperimental feature anymore
- CI | DietPi-Software test: 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
  • Loading branch information
MichaIng committed Jan 7, 2025
1 parent ade062f commit b694332
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/dietpi-software.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 6 additions & 6 deletions dietpi/dietpi-software
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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.'
Expand All @@ -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
Expand All @@ -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]
Expand Down

0 comments on commit b694332

Please sign in to comment.