Swap is a Swap partition in Linux, similar to Windows virtual memory. when the physical memory is insufficient, the system can put some programs that are not frequently used in the memory into Swap to solve the problem of insufficient physical memory. If the Swap space opened during system installation is too small, you can manually create a Swap file. 1. create the file ddif =/dev/zeroof = kwxgdbs = 1024 count = 1024000SSH and execute the preceding commands,
Swap is a Swap partition in Linux, similar to Windows virtual memory. when the physical memory is insufficient, the system can put some programs that are not frequently used in the memory into Swap to solve the problem of insufficient physical memory.
If the Swap space opened during system installation is too small, you can manually create a Swap file.
1. create a file
dd if=/dev/zero of=kwxgd bs=1024 count=1024000
Run the preceding command in SSH to create a 1G empty file named kwxgd (write 0 occupies disk ).
II. create a Swap file
mkswap kwxgd
Run the preceding command in SSH to generate the generated kwxgd as a SWAP file. if the SWAP file is not created, the following error may occur during the next step: "swapon: kwxgd: read swap header failed: invalid argument "error.
3. make the Swap file take effect
swapon kwxgd
Run the preceding command in SSH to make the "kwxgd" Swap file take effect and overwrite it into the current sawp space.
4. view the current SWAP
swapon -s
Run the preceding command in SSH to view the current situation of swap.
5. Automatic mounting
1) edit/etc/fstab
vi /etc/fstab
2) Fill in according to the format
/root/kwxgd swap swap defaults 0 1
Enter the preceding information in the format and save it, as shown in.