Linux memory mechanism and manual release of swap and memory, linux mechanism to release swap
Today, let's talk about the Linux memory mechanism.
First, let's take a look at the concept
1. What is the linux memory mechanism?
We kn
bottleneck on the IO, relying on the speed of the CPU can not solve the problem.Root User under1, the file system to increase (the following is to increase the 512M file system for example)DD If=/dev/zero of=/home/oracle/myswaps/swapfile1 bs=1m count=512Note: The After path must not be in/dev or the Times parameter in the active swap file is invalid2. Create swap fileMkswap/home/oracle/myswaps/swapfile13.
automatically mount the boot[~]# Vi/etc/fstab#/etc/fstab# Created by Anaconda on Fri Oct 14 22:27:19 2016## Accessible filesystems, by reference, is maintained under '/dev/disk '# See mans Pages Fstab (5), Findfs (8), mount (8) and/or Blkid (8) for more info#UUID=BD82CAD1-2B0A-4984-9846-06E690B1FDAD/EXT3 Defaults 1 1Uuid=6d8f8e24-7849-4ad9-af35-7e8fb71eb7ec/boot ext3 Defaults 1 2uuid=dc268ee4-ba91-471f-9acf-94d0a2658083 swap
out the memory space of these programs, there is no need to put the file part of the data into the swap space, and can directly put it into the file. If it is a read file operation, then the memory data is released directly, do not need to swap out, because the next time you need to recover from the file system direct
Preface: We just started installing Ubuntu on the virtual machine, always reluctant to allocate too much hard disk space. But with a long time to use the hard drive is not enough. One of the stupidest ways to do this is to reload the system, but it's time-consuming. It would be nice if you could add a hard drive without reloading the system. Here's how to implement it.
Two.
1. First of all, the Ubun
Sometimes you may encounter a situation where a virtual hard disk is assigned to VMware at the beginning. After Linux is installed, the virtual hard disk capacity becomes insufficient and the space needs to be expanded as the number of applications increases. The following describes how to add Linux File System
. Using Mkswap format file as swap file system
12
Mkswap-f/swap#-f using files as swap swap areas
3. Enable the swap file you just created
1
Swapon/swap
4. If necessa
in the process of use, you often encounter virtual machine disk space is not enough or on demand to increase the hard disk situation. the detailed steps for adding a hard disk or adding hard disk space to Linux in VMware are as follows:First, Vmware in the Linux ways to add
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
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
LVM management reduces swap partition space and increases to the root Partition
Introduction
LVM is short for Logical Volume Manager (Logical Volume management). It is a mechanism for managing disk partitions in Linux. It is implemented by Heinz Mauelshagen on the Linux 2.4 kernel.
PhysicalStorageMedia)
It refers to th
change it to LVM.#fdisk/DEV/SDACommand (M for help): MCommand (M for help): t//change partition system IDPartition number (1-4): 3//Specify partition numbersHex code (type L to list codes): 8e//Specifies the ID number to be changed, and 8e represents LVM.Command (M for help): WThird, after restarting the system, the landing system. (Be sure to restart the system, or you will not be able to expand the new partition)D. Format the newly added partition:#fdisk-LDevice Boot Start End Blocks Id Syste
1. swap overview Swap partition, that is, Swap zone. The role of swap space can be simply described as: when the system's physical memory is insufficient, you need to release some of the physical memory space, for the currently ru
Swap space in Linux is used when physical memory RAM is full. If the system requires more memory resources and the physical memory is full, the inactive pages in the memory will be moved to the Swap space.
Although Swap
partition, such as/dev/sda6, or a file/swapfile
-C check whether there are bad channels before creating a swap space. If there are bad channels, the total number of bad channels is displayed.
-F: run the mkswap command forcibly.
-P
-L
-V0: creates an old-style swap zone.
-V1 creates a new exchange zone. The parameter can be omitted. The preceding command is us
In the process of daily operations, we often encounter the lack of swap space, and even nagios to swap monitoring as a basic system monitoring items, enough to see the importance of this performance indicators.In general, MySQL database machine is more prone to swap space is
Linux file system swap swap partition and DD command details (3)1. Create swap partition: Partition type 82 is equivalent to virtual memory in WindowsMkswap/dev/sda5 creating a Swap partition file system region-L label create label for s
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.