The difference between buffer and cache

Source: Internet
Author: User

Buffer and cache are collectively referred to as caches, and function and function differ:

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/83/A5/wKiom1d5we_AQMiQAABDfsfBkPQ881.png "title=" The difference between buffer and cache. png "alt=" Wkiom1d5we_aqmiqaabdfsfbkpq881.png "/>

1) buffer, memory buffer, the file temporary storage area generated by each process, the unified write disk in a certain period of time, reduce disk fragmentation and hard disk repeatedly seek, thereby improving system performance;

2) cache, memory buffer, often used on disk I/O requests, if there are files frequently accessed, the system will be cached in the cache area for CPU processes, such as access, the CPU of the first-level cache, two-level cache, or even three-level cache is to solve the read memory speed bottleneck;


And how is the available memory in Linux calculated?

Linux uses the memory principle as much as possible, and memory applies the remaining space to the cache, and the cache does not belong to the free

When the system is running for a long time, we will find that the cache is very large, that's the truth.

Note that when we see the system memory usage is very high, free is almost 0 o'clock, does not mean that the system memory capacity bottleneck! Only the system has fully played the role of memory. When a process needs to request large file memory, the kernel reclaims some of the cache space, and the reclaimed memory is then allocated to the process program for use.


So ...


650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/83/A5/wKioL1d5yFTAIegIAAAXcVVXoEs123.png "title=" QQ picture 20160704102138.png "alt=" Wkiol1d5yftaiegiaaaxcvvxoes123.png "/>

Available memory = Free + buffer + cache

Memory Availability =1-(buffer used/total) =1-(237/981) =76%

Instead of: 170/981=17%


The difference between buffer and cache

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.