Swap is the swap partition under Linux, similar to the virtual memory of windows, when the physical memory is low, the system can put some memory of infrequently used programs into swap, to solve the situation of physical memory shortage.
If the swap space created by the system installation is too small, you can create swap files manually.
First, create a file
DD If=/dev/zero of=/root/swapfile bs=1024 count=1024000
SSH executes the above command to create a 1G empty file named Kwxgd (write 0 to occupy the disk).
Second, make the swap file
Mkswap KWXGD
SSH executes the above command, the generated KWXGD is made into swap files, if you do not make swap files, the next step may appear: "Swapon:kwxgd:read swap header failed:invalid argument" error.
Third, the swap file to enter into force
Swapon KWXGD
SSH executes the above command so that the "KWXGD" swap file takes effect and is superimposed into the current SAWP space.
Iv. View Current Swap
Swapon-s
SSH executes the above command to see the current swap situation.
Five, automatic mount
1) Edit/etc/fstab
Vi/etc/fstab
2) fill in by format
/root/swapfile Swap swap Defaults 0 1
This article from "the more efforts, the more fortunate!" "Blog, be sure to keep this provenance http://7250365.blog.51cto.com/7240365/1690729
Linux Manually create swap