System FAQ
Q1: The system has no swap by default and processes get killed by the OOM killer when memory runs out. How do I configure swap?
A: Create and enable a 4GB swap file.
bash
sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon -p 10 /swapfile
echo '/swapfile none swap sw,pri=10 0 0' | sudo tee -a /etc/fstab
echo 'vm.swappiness=100' | sudo tee /etc/sysctl.d/99-swap.conf
sudo sysctl -p /etc/sysctl.d/99-swap.confVerify
bash
swapon --show
free -mExample output
NAME TYPE SIZE USED PRIO
/swapfile file 4G 0B 10Restore the default state (no swap)
bash
sudo swapoff /swapfile
sudo sed -i '\#/swapfile#d' /etc/fstab
sudo rm -f /swapfile /etc/sysctl.d/99-swap.confVerify
bash
free -m | grep -i swapIf the output is Swap: 0 0 0, the system is back to the default state.
Last updated: 2026/11/25
Tip
If the issues above cannot be resolved, please contact APLUX technical support at noah.yang@aidlux.com.