Linux cached memory Analysis

Source: Internet
Author: User


To test the MBS system, weblogic only sets 99% GB of memory for the AP. However, after three stability tests, the memory usage reaches. Nmon monitoring revealed the existence of GB cached Memory. The following describes: Linux and Windows may have Cache Memory, which is usually called Cache Memory. Sometimes you will find that no program is running, but using the top or free command shows that the available memory is very small. Www.2cto.com what is Cache Memory (Cache Memory): When you read and write files, the Linux kernel caches files in the Memory to improve read and write efficiency and speed, this part of Memory is Cache Memory ). The Cache Memory will not be automatically released even after your program runs. This will cause your program to read and write files frequently in Linux, and you will find that there is very little available physical memory. In fact, this Cache Memory will be automatically released when you need to use the Memory, so you do not have to worry about no Memory available. You can also manually release the Cache Memory. Release Cache Memory (Cache Memory): use the following command to release Cache Memory: [rootmin @ localhost ~] # Echo 3> how to release cache memory in/proc/sys/vm/drop_caches Linux because of the LINUX kernel mechanism, you generally do not need to release the used cache. The cached content can increase the file and read/write speed. First, let's talk about how to view the memory using the free command [rootmin @ localhost ~] # Free total used free shared buffers cached Mem: 515588 295452 220136 0 2060 64040-/+ buffers/cache: 229352 286236 Swap: 682720 112 682608 the first line describes the memory usage of the system from a global perspective: total -- total physical memory www.2cto.com used -- used memory. Generally, this value is relatively large, this value includes the cache + memory used by the application free -- completely unused memory shared -- Application shared memory buffers -- cache, which is mainly used for directory, inode value (this value can be seen in the ls directory) cached-cache, used for opened files Note: total = used + free used = buffers + cached (maybe add shared also) second Line Description: memory usage of the application: the first value indicates-buffers/cache-the memory size used by the application, used minus the cache value + buffers/cache -- memory size used by all available applications, note-buffers/cache = used-buffers-cached + buffers/cache = free + buffers + cached the third line indicates the use of swap: www.2cto.com used -- used free -- released without cache: 1. to free pagecache: [rootmin @ localhost ~] # Echo 1>/proc/sys/vm/drop_caches 2. To free dentries and inodes: [rootmin @ localhost ~] # Echo 2>/proc/sys/vm/drop_caches 3. To free pagecache, dentries and inodes: [rootmin @ localhost ~] # Echo 3>/proc/sys/vm/drop_caches: it is best to sync before release to prevent data loss.
Author litertiger

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.