Original posted Address: http://blog.csdn.net/%ef%bd%84%ef%bd%8c%ef%bd%98%ef%bd%95/archive/2007/06/13/1650097.aspx
Add swap space to Linux
In the installation of Linux, do not know how much swap
It may be that we use a smaller VPS system with less memory performance when running certain programs. Here we can focus on creating and increasing swap space for Linux Xen VPS hosts, which provide sufficient resources for the program to run. Swap is just like the virtual memory of our Windows system, which can be used
Article Title: manually add SWAP space for Linux. Linux is a technology channel of the IT lab in China. Including desktop applications, Linux system management, kernel research, embedded systems, open source, and other basic categ
* *************************** Environment for adding Swap space in Linux: CentOS6.2author: youseesan ***************************** mkdir/var/swapwww.2cto.com --- create a specified size file. swp1024 bytes 65536/
* ***************************** Add an environment for Swap
If SWAP space is insufficient, how can I manually add SWAP space? The following operations must be performed under the root user. First, create a partition and run the dd command, for example, ddifdevzero.
If SWAP
#需求Need to add 10G swap space due to tight system memory resources#创建存放swap文件的目录[Email protected] ~]# Mkdir/swap#创建一个10G空文件[[email protected] ~]# dd If=/dev/zero of=/swap/swap bs=1024m
command to view the swap space, with the following output:Filename Type Size Used Priority/dev/sda5 partition 859436 0 -1Each row is a swap space that the system is using. Here the ' Type ' field indicates that the swap
Linux swap space, linuxswap swap
Linux memory uses virtual memory to manage the entire memory. physical RAM physical memory and swap space are the total amount of virtual memory.Use Cas
swap Zone
[root@linuxtechi ~]# mkswap /swap_file
Setting up swapspace version 1, size =1048572KiB
no label, UUID=f7b3ae59-c09a-4dc2-ba4d-c02abb7db33b
[root@linuxtechi ~]#
Step 4: Add swap file entries to the fstab file
Add the following entries to the fstab file so that the files can be used after each restart.
Zone
[root@linuxtechi ~]# mkswap /swap_file
Setting up swapspace version 1, size = 1048572 KiB
no label, UUID=f7b3ae59-c09a-4dc2-ba4d-c02abb7db33b
[root@linuxtechi ~]#
Step 4: Add swap file entries to the fstab file
Add the following entries to the fstab file so that the files can be used after each restart.
/swap_file
Linux memory manages the entire memory through virtual memory, and physical RAM physical memory and swap space are the total virtual memories.Swap usage ScenariosThere are two main uses of swap1, when the system needs more memory space than the physical memory, the kernel will use less memory inside the memory page
Imagine a scenario where our Linux system runs out of swap space, in which case we want to expand the swap space using the swap partition, but in some cases there is no free partition available on the disk, so we can't expand it.
Imagine a scenario where our Linux system runs out of swap space, in which case we want to expand the swap space using the swap partition, but in some cases there is no free partition available on the disk, so we can't expand it.
Imagine a scenario where our Linux system runs out of swap space, in which case we want to expand the swap space with the swap partition, but in some cases there is no free partition available on the disk, so we can't expand it.Th
Add swap swap partition
Swap-swap is a function similar to the virtual memory of Windows system, the use of a portion of the hard disk space virtual into memory, so as to solve the situation of insufficient memory capacit
Swap threshold Value Setting1. Check the current system swap threshold [email protected]~$ CAT/PROC/SYS/VM/SWAPPINESS60 memory when used to 100-60=40%, the use of switched partitions begins to appear swappiness= 0 indicates the maximum use of physical memory before using swap space, swappiness=100 indicates active use
If swap space is insufficient, how can I manually add swap space? The following operations must be performed under the root user:First, create a partition and use the DD command, suchDd If =/dev/Zero of =/home/swap BS = 1024 COUNT
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.