Increase virtual memory in Centos to quickly increase swap partitions

Source: Internet
Author: User

Lab environment:

There are two important reasons for creating a swap partition.

First, when the physical memory is insufficient to support system and application (process) operations, this swap space can be used as a temporary storage page for memory with low usage, allocate free memory to applications (processes) that are in urgent need.

Second, even if your machine has enough physical memory, some programs will transfer the paging content that is rarely used during their initialization to the swap space, in this way, physical memory space is provided. For applications (processes) with a probability of Memory leakage, the swap space is even more important, because no one wants to see the system crash due to insufficient physical memory.

Step 1: first divide a partition, for example, divide a primary partition from the second hard disk sdb, with the size of 1 GB.

The Administrator should develop a good habit, because this should be used as a swap partition, so the partition identifier is 82.

Use free-m to view the usage of the memory virtual memory swap.

Convert the sdb1 partition to the virtual memory swap and activate the virtual memory through swapong. Then we can see from free-m that the virtual memory has changed from 2 GB to 3 GB.

If you want this virtual memory to be used permanently, You need to modify/etc/fstab and write the virtual memory mounting information.

After modifying/etc/fstab, use swapon-a to re-read the virtual memory mounting information in the fstab file.

This article is from the blog of "the Linux open source technology blog", please be sure to keep this source http://dreamfire.blog.51cto.com/418026/1085693


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.