Knowledge about memory release in Linux-pseudo proposition for manual memory release

Source: Internet
Author: User

When using Linux, you will find a very strange problem: after using the TOP command for a period of time (especially after file copying and other operations), you will find that the memory is basically occupied, in addition, Linux will not be released. This problem has indeed plagued us. We began to look for ways to manually release the memory. We did find it, and it also produced my previous blog. Internet search also found that many people have this problem, but after a comprehensive analysis of the online results and my own understanding, it is concluded that the manual release of memory in Linux is a completely false proposition.

 

First, explain the meaning of each top option:

Total: physical memory available for all applications
Free: memory not used by the application
Used: memory used
Total = free + used

Shared: Shared Memory occupied by the shared library
Buffers: Memory Used for file Buffering
Cached: kernel buffer virtual memory
Shared, buffers, and cached are included in used.

 

In fact, after the kernel finishes a program, it will release the memory, but the kernel does not immediately collect this part into free, but exists in cached or buffer, improves the system's Io efficiency. The cache and buffered memory are dynamically configured and managed by the kernel. If the system's free size is insufficient, the system automatically releases the cache buffer memory for the program. (If you see a lot of used, it is not necessary to manually release the memory)

 

That is to say, Linux will use as much memory as possible to improve the system speed and IO efficiency, but it has a corresponding mechanism to release the memory, in fact, we can simply understand that cache and buffer are free space.

When does it mean that your memory is not enough? That is, there are a lot of used, but the proportion of cache and buffer is very small, indicating that the memory is not enough. Many netizens said that used accounts for a lot and free is rarely uncomfortable. Simple psychology: the more free memory, the happier it looks ?? Yes ?? We recommend that GNU display the free memory as the sum of cached and buffer. Let's say: Linux memory is used, and Windows Memory is used for viewing.

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.