Manually clear or refresh the SWAP partition of Centos

Source: Internet
Author: User
When a linux (Centos) server is running, it often encounters some accesses that exceed the server's physical memory limit. to maintain normal server operation, you can configure swap partitions for the server and use hard disks to buffer memory shortage. However, the data allocated to the SWAP partition will not be automatically released after the peak access. when the SWAP usage exceeds 30%, the system performance will be affected. In this case, you need to manually refresh the system's SWAP partition to transfer the slow data read from the SWAP partition to the physical memory.

When a linux (Centos) server is running, it often encounters some accesses that exceed the server's physical memory limit. to maintain normal server operation, you can configure swap partitions for the server and use hard disks to buffer memory shortage.

However, the data allocated to the SWAP partition will not be automatically released after the peak access. when the SWAP usage exceeds 30%, the system performance will be affected. In this case, you need to manually refresh the system's SWAP partition to transfer the slow data read from the SWAP partition to the physical memory.

Command to refresh SWAP partition:

Swapoff-a & swapon-

Instance:

Note: disable the swap command:

Swapoff-

Run the following command to enable swap:

Swapon-

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.