This article is a mirror article of machine translation, please click here to jump to the original article.

View: 4079|Reply: 1

[linux] Excessive memory buff/cache usage under Linux

[Copy link]
Posted on 12/10/2022 12:07:49 PM | | | |
Requirements: Use the free -h command to check the memory usage, and find that the available memory is less than 1G, the system has just been installed, and it has not executed too many service programs.

Reason: buff is a write file cache, cache is a read file cache, Linux will not release the cache immediately after the cache is used, but is used to cache other information to improve IO efficiency, soIf there are too large file read and write operations, the buff/cache will become high

In Linux, you will often encounter the problem of excessive buff/cache memory usage, especially when using cloud hosts, because many of them are virtual memory, so if buff/cache occupies too much memory, there will be very little free free memory, which will affect the use;

Typically the memory relationship is:

Normal machine: total=used+free

Virtual machine: total=used+free+buff/cache



buff/cache is a file cache caused by system reads and writes, which is not released in time, and the solution is as follows:

The value of drop_caches can be a number between 0-3, representing different meanings:

0: Do not release (system default)
1: Free the page cache
2 : to release dentries and inodes
3: Free all caches

After execution, as shown below:



(End)





Previous:VS 2022 sets up the project to generate a .pdb file
Next:Difference between ASCII code, ISO8859-1, Unicode, GBK, and UTF-8
Posted on 12/11/2022 11:01:30 PM |
Learn it
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com