Linux Foundation-----Memory Management

Source: Internet
Author: User

FREE-M Viewing memory size

Mem: Physical Memory statistics

Total Physical Memory size

Used to use memory (contains buffers;bached)

Free memory

GKFX Shared Memory

Buffers buffering (for write operations)

Cached cache (for read operations)


-+ buffers/cached

Used (not including buffers and cached; actual memory usage)

Free (contains buffers and cached; actual idle memory)

According to the above analysis, we can draw a conclusion:

1. Actual Available memory Size:

free= Free (MEM) +buffers (MEM) +cached (MEM);

2. Allocated Memory Size:

Used (MEM) = Used-(buffers (MEM) + Cached (MEM)


Swap

Total Swap partition size

Used swap partition for use

Free Swap partition

Cache

Cache: Caching is a small but high-speed memory that sits between the CPU and the main memory.

Because the CPU speed is much higher than the main memory, the CPU accesses the data directly from the memory to wait for a certain period of time, the cache holds the CPU just used or recycled part of the data, when the CPU re-use the part of the data can be directly called from the cache, which reduces the CPU waiting time, Improve the efficiency of the system.

The cache is also divided into one-level cache (L1 cache) and level two cache (L2 cache), L1 cache is integrated within the CPU, L2 cache is usually soldered to the motherboard, and is now integrated into the CPU, with a common capacity of 256KB or 512KB L2 Cache.


Buffer

Buffer: An area where data is transferred between devices that are not synchronized or that have different priority levels. Through buffers, you can reduce the number of waits between processes, so that when you read data from a slow device, the operating process of a fast device is uninterrupted.

Two Swap partition swap for Linux

Simulate a block of hard disk space into memory storage format when physical memory is not enough

A new process is staging some data in physical memory to the swap partition while using memory

If the data is used, then the data is re-swapped into physical memory


Impact of swap configuration on performance

Swap too much wasted disk space, and the swap space is too small, the system will error. There is too much physical memory, the system is running slowly, but it still works, and if the swap space is exhausted, the system will get an error. For example, the Web server can derive multiple service processes (or threads) depending on the number of requests, and if the swap space is exhausted, the service process will not start, typically "application is of memory", and the process will be locked down when critical.


such as a Web server or data server for high performance requirements, the swap partition does not need to be too large, about 2G enough to use, as far as possible to make Web services use physical memory efficient processing


If a server that requires a lot of computing work teaches stability requirements, the swap partition can be larger, such as 2 to 4 times times the memory


This article is from the "Hanging Swords" blog, make sure to keep this source http://sublime.blog.51cto.com/8856101/1533402

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.