Swap space
The operating system can temporarily swap out some of the memory data to the disk's swap space to free up more memory space, or swap the data into memory from an exchange space.
Linux supports two types of swap space
1. Swap partitions
2. Swap space
The Linux system can have up to 32 swap spaces, with a maximum of 2GB per swap space on a 386-compatible platform.
Recommendations for allocating swap space: 4MB or 8MB, typically 1 to twice times of physical memory
Creation of swap partitions
(1) Preparation: Create a partition/DEV/SDB1 and set its type to the "(Linux Swap)"
(2) format swap partition
Mkswap/dev/sdb1
(3) Enable swap partition
Swapon/dev/sdb1
view swap partition, swap file status : Swapon-s or with free
Deactivate swap partition: SWAPOFF/DEV/SDB1
Creation of swap files
(1) Create a new empty file
DD If=/dev/zero of=/tmp/swapfile bs=1m count=200
(2) format the file as a swap file
Mkswap/tmp/swapfile
(3) Enable swap file
Swapon/tmp/swapfile
(4) If you want to activate this swap file automatically when the system starts, add the following line to the/etc/fstab
/tmp/swapfile Swap swap defaults 0 0
Deactivate swap file: Swapoff/tmp/swapfile
This article is from the "IT" blog, so be sure to keep this source http://wang119.blog.51cto.com/9428009/1795374
Linux Swap Space