Linux Increases swap Space

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.