1, use the partition:When the OS is installed, a dedicated swap partition is created, and the size of the space must be planned in advance and mount automatically when the system is booted.This method can only be set when the OS is installed, and once the settings are changed very hard, unless the system is reinstalled.2. Use Swapfile: (or the entire free partition)Create a new temporary swapfile or an idle partition, set to
Practice a1, create a 1G partition, the file system is EXT4, the volume is labeled MyData, the block size is 1024, the reserved management space for the disk3% of the partition requires that the brake be mounted to the/data directory, and automatically mounted devices are referenced using the volume label.FDISK/DEV/SDA [Email protected] ~]# FDISK/DEV/SDAWarning:dos-compatible mode is deprecated. It ' s strongly recommended toSwitch off the mode (command ' C ') and change display units toSectors
#!/bin/bash############################################################################### Scripting Feature: Lists the processes that are occupying swap.###############################################################################Echo-e "Pid\t\tswap\t\tproc_name"# Take out all the numbers in the/proc directory (the process name is the number is the process, others such as sys,net, etc. are stored in other information)For PID in ' Ls-l/proc | grep ^
It's a programmer who knows how to exchange values in C/s + +:[CPP]View Plaincopyprint?
void swap (inta,intb)
{
int temp;
temp = A;
A = b;
b = temp;
}
In Java, however, this approach does not work because "Java does not support reference passing for variables of a normal type ."What do we do?1. You can do this by passing an array (which is also part of the value of the pass) as follows (this is what many sort al
Before the installation of Linux, at the start, every time to enabling Swap space to stay about 5 minutes.
The resolution process is as follows:
(1) View startup log Cat/var/log/boot.log
To see how long the system spends on that service at boot time
Focus on SendMail and sm-client services
This section of my log information is as follows:
June 09:20:06 Zhangweiserver xinetd:xinetd start succeeded
June 09:22:07 Zhangweiserver Sendmail:sendmail start su
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=1024 count=5120000This creates the/home/swap partition file. The size of
Tags: bin pts 1.4 Sys creating DOS/ETC nbsp CRCFirst, disk formatDisk partition can not be used directly, you need to format each partition, formatting is actually installed system files.Command mke2fs: Formatting into XFS system files is not supportedMKFS.EXT4 = = mke2fs-t ext4 two commands equal-B: Sets the amount of space that each data chunk occupies when partitioning-I: Indicates the size of the inode is set-N: Indicates data for inode setting-C: Indicates if there is a problem detecting th
When I installed ubuntu12.04LTS in Ubuntu12.04, due to the disk partition problem, I did not set the SWAP partition during installation. later, when I was using it, sometimes the system was not running smoothly, it seems that SWAP partitions are still needed. Www.2cto. com1 .... when I installed Ubuntu 12.04 LTS for SWAP settings in ubuntu 12.04, I did not set
Swap is the memory swap area; in other words, if the memory is not enough, then the system will store some infrequently used data on the hard disk, then this part of the data in the storage to be broken down, so that the memory of the remaining space to run the east, this process is called exchange, The part of the hard disk that stores the data is the swap parti
IntroductionIn my last blog, I spoke about the swap function.The swap is only part of the STL and then becomes the spine of an unusually safe program, and is used to handle the possibility of self-assignment.One, swap functionThe swap function of the standard library is as follows:1 namespace STD {2 template3 v
Wow, it's been a long time since it's been updated, let's talk about Linux's memory mechanism today.First, let's take a look at the conceptFirst, what is the memory mechanism of Linux?We know that reading and writing data directly from physical memory is much faster than reading and writing data from a hard disk, so we want all of the data read and written to be done in memory, and memory is limited, which leads to the concept of physical and virtual memory.Physical memory is the amount of memor
Understand what a swap partition is
Swap is a virtual memory partition under Linux, his main role is that when physical memory is not enough, it is necessary to release some of the space in physical memory, so that the current program to use, these memory freed space has no operational procedures, these freed memory will be saved into the swap space, Wait until
If your server is always reporting low memory, and often because the service is forced to kill because of insufficient memory, without adding physical memory, enabling the swap Swap area as virtual memory is a good choice, I buy the Digitalocean VPS 512M memory is basically not enough , fortunately, the VPS used by the hen SSD, normal read and write speed above 300mb/s, enable
Swap is used if the system's physical memory is used up. The system will run slowly but still run. If swap space is used up, the system will have an error. Generally, the error "application is out of memory" may occur. In severe cases, the service process may be deadlocked. Therefore, we must attach great importance to it.
There are many ways to view swap:Free
Free-m
We can see the
How to add swap?
Swap is generally in a proprietary swap zone. This may be because the system prompts you to create a swap zone during installation. But in fact, any file can be used as a SWAp (SWAP device), whether it is a parti
way, the cluster of all the storage space in the resources of the integration, and external to the unified interface to provide file access to a file system. Swap partition :swap. Iii. Ext4 File system How to manage filesEXT4 is a commonly used file system, a brief introduction to the management of the file system.650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/7D/2F/wKiom1bhdyDT1wWkAAB4i_NFmc43
On Oracle servers, setting the appropriate swap size can improve Oracle performance, and for Oracle 11g, the physical memory on the Oracle server and the swap size to be set are as follows: If physical memory is less than or equal to 2GB,Then swap should be 1.5 times times the physical memory, and if the physical is between 2GB and 16GB, the
Tags: color STS file Activation tab FST Modify create Mount1. create partition file, size 2Gif=/dev/zero of=/swapfile bs=1k count=20480002. Generate swap file systemMkswap/swapfile3. Activating swap FilesSwapon/swapfileThere is a problem with the wood, but this does not automatically mount the swap partition when the system restarts, so we need to modify the fsta
partition number, we can distinguish the disk partition from the UUID and complete the mount, and use the command Blkid to view it.Using the UUID Mount method,mount UUID="2b2fd647-2c11-4e19-9ab3-11c8fbd0d462" /tmpIf you want a partition to be mounted automatically after booting, there are two ways to do so:Add a row to the/etc/fstab, as in the previous example;Write the Mount command to the/etc/rc.d/rc.local file.echo ‘mount UUID="2b2fd647-2c11-4e19-9ab3-11c8fbd0d462" /tmp‘ >>/etc/rc.d/rc.local
Original source
Https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-centos-6
Check for swap spaces checking Swap space
Before we proceed to set up a swap file, we need to check if any swap files have been enabled by looking at the summary of
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.