In the virtual machine to do experiments, need to swap large, below to share a simple Add method, it should be noted that the specific file directory is located where
Run: free-m, can query physical memory size and swap space size, swap space should usually be twice times larger than physical memory.
To increase the swap space step:
1, DD if=/dev/zero of=/home/swap bs=1024x768 count=5120000
This creates the/home/swap partition file. The size of the file is 512,000 blocks, normally 1 blocks are 1 K, so the space here is 5120M.
2,/sbin/mkswap/home/swap
Turn this partition into a swap partition.
3,/sbin/swapon/home/swap
Make it a valid state.
Now, using the FREE-M command to see the size of the memory and swap partitions, we found an increase of 5120M.
####
1, pay attention to the path to choose according to the actual situation
2, the space size should be increased as appropriate
Linux Increases swap Space