diff --git a/packages/sysutils/busybox/init.d/09_swapfile b/packages/sysutils/busybox/init.d/09_swapfile index 38c11a5377..e004459209 100755 --- a/packages/sysutils/busybox/init.d/09_swapfile +++ b/packages/sysutils/busybox/init.d/09_swapfile @@ -40,5 +40,15 @@ if [ $INSTALLED_MEMORY -le 500000 ]; then fi progress "enable swapfile" - swapon $HOME/.cache/swapfile + swapon -p 10000 $HOME/.cache/swapfile + + [ $INSTALLED_MEMORY -le 260000 ] \ + && sysctl -w vm.swappiness=100 \ + || sysctl -w vm.swappiness=60 + +else + + sysctl -w vm.swappiness=0 + fi +