1024programmer Linux Introduce two methods to create memory swap space swap-linux operation and maintenance

Introduce two methods to create memory swap space swap-linux operation and maintenance

First, let’s introduce the role of swap. Generally, when we have installed the linux operating system, the system will create a swap partition by default. Let’s take a look at the usage of the swap partition on the server

# free -h
               total used free shared buff/cache available
 Mem: 992M 630M 68M 264K 293M 198M
 Swap: 1.0G 96M 927M

The size of the swap partition of this server is 1G. This swap partition is created by the system by default. We will increase the capacity of the swap partition on this basis later.

The swap partition is called the swap partition, which acts as a special hard disk space and acts as a memory. When the system memory is not enough, the system will store some data in the memory that will not be used temporarily in the swap partition. The advantage of using the swap partition is that the price of the hard disk is far cheaper than the memory, so this is a very economical way to increase the system memory. However, if swap is used frequently, it will greatly affect the operating speed of the system. Therefore, the best usage strategy for the swap partition is “preparation and not use”.

Next, let’s take a look at how to create a swap partition.

Construct swap partition through physical partition

First of all, you need to partition

Today, I introduced two methods to build a swap partition. Generally, the size of the swap partition is recommended to be within 2G. Remember that the function of the swap partition is to use the hard disk space as memory when the memory is not enough.

The above is the detailed content of the two methods to create memory swap space, please pay attention to other related articles on 1024programmer.com for more information!

This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/introduce-two-methods-to-create-memory-swap-space-swap-linux-operation-and-maintenance/

author: admin

Previous article
Next article

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索