Reasons for high memory usage in Linux

Source: Internet
Author: User
The reason for the high memory usage in Linux-Linux general technology-Linux programming and kernel information. The following is a detailed description. When linux reads a file for the first time and runs it, one file is cached in one piece of memory, and the other is cached in the memory of the running program, which runs normally. When the program runs successfully, it is disabled, when the cache takes a minute but does not release the second operation, the system first checks whether there is a copy of the cache saved during the memory. If yes, read from the memory directly, and the speed will be much faster. A typical example of this situation is to start firefox. Because the firefox program is large, it is very slow to read and run for the first time, especially on machines with low speed, however, when you completely disable firefox, ps cannot see a firefox process, and the second restart is much faster than the first one, this is because the system runs on firefox directly read from the cache, not from the disk. Another example is the frequently used ls commands and other basic commands. You cannot see the hard drive flash when running them, because these common commands are saved in the cache after the first operation, it will be read and run from the memory in the future.

If the cache occupies too much memory and affects the memory required by normal programs, some of the cache memory will be released, but the total amount will remain a high value, linux can always use the maximum memory, even if it is added to 16 GB, 32 GB memory, it will continue with IO operations, the memory free value will gradually be reduced to only a few MB, there is only one way to keep the memory from this situation: the memory is larger than the hard disk.
Related Article

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.