xEntering the following commands in sequence can increase the swap space by 3G and solve some program errors that run out of memory.
sudo fallocate -l 3G /var/swapfile
sudo chmod 600 /var/swapfile
sudo mkswap /var/swapfile
sudo swapon /var/swapfile
sudo bash -c 'echo "/var/swapfile swap swap defaults 0 0" >> /etc/fstab'
1.Add swapfile file size customization
sudo fallocate -l 3G /var/swapfile
2.Configure permissions for this file
sudo chmod 600 /var/swapfile
3.Establish exchange partition
sudo mkswap /var/swapfile
4.Enable swap partitioning
sudo swapon /var/swapfile
sudo bash -c 'echo "/var/swapfile swap swap defaults 0 0" >> /etc/fstab'
Set to automatically enable swapfile
xxxxxxxxxx
jtop
Swap has become 6g.