Last update at :2024-05-16,Edit by888u
The default swap space for bricklayers is very small or not at all. Search the Internet for methods to add swap to vps here:
System:centos6
The following operations must be performed under the root user. First, create a partition and use the dd command such as: dd if=/dev/zero of=/home/swap bs=1024 count=1024000This will create a partition file like /home/swap. The size of the file is 1024000 blocks, Generally, a block is 1K, so the space here is 1024M. Then turn this partition into a swap partition.
/sbin/mkswap -f /home/swapThen activate the swap partition. Make it valid.
/sbin/swapon -f /home/swapNow use the free -m command to check the memory and swap partition size, and find that 1024M of space has been added. However, after the computer restarted, it was found that the swap was still as large as before. The new swap did not start automatically and had to be started manually. Then we need to modify the vi /etc/fstab file and add the following line:
/home/swap swap swap defaults 0 0You will find that the swap space has changed after your machine starts automatically, but the actual display of 1024m above is 1000m.
Recommended site searches: Hong Kong IP, best US server, independent IP space, network registration, ICP registration query, IP query, domain name registration website, Korean cn2 server, free mainland China space, cn domain name registration,
发表评论