In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
In this issue, the editor will bring you about how to query the real utilization of memory in Linux. The article is rich in content and analyzes and describes for you from a professional point of view. I hope you can get something after reading this article.
The following shows that free is showing the current memory usage, and-m means M bytes to display the content. Let's have a look together.
$free-m
Total used free shared buffers cached
Mem: 1002 769 232 0 62 421
-/ + buffers/cache: 286 715
Swap: 1153 0 1153
-
Real memory usage = used-buffers-cached = 286
-
The first part is the Mem line:
Total total memory: 1002m
Number of memory used by used: 769m
Number of free memory in free: 232m
Shared is currently obsolete, always 0
Number of buffers Buffer cache memory: 62m
Number of cached Page cache memory: 421m
Relation: total (1002m) = used (769m) + free (232m)
The second part (- / + buffers/cache):
(- buffers/cache) used memory: 286m (refers to used-buffers-cached in the first part of the Mem line)
(+ buffers/cache) free memory: 715m (refers to free + buffers + cached in the first part of the Mem line)
Visible-buffers/cache reflects the memory actually eaten by the program, while + buffers/cache reflects the total amount of memory that can be misappropriated.
The third part refers to the exchange partition, I think we all understand.
I think everyone is still dizzy when they look up there. The results of the first part (Mem) and the second part (- / + buffers/cache) deal with why used and free are so strange.
In fact, we can explain it from two aspects.
For the operating system, it is a parameter of Mem. Buffers / cached are used, so it thinks that free is only 232. 0.
For applications, (- / + buffers/cach). Buffers/cached is equally available because buffer/cached is designed to improve the performance of program execution, and buffer/cached is quickly used when the program uses memory.
Therefore, to look at the application, to (- / + buffers/cache) free and used-based. So let's just look at this. In addition to tell you some common sense. Linux in order to improve disk and memory access efficiency, Linux has done a lot of careful design, in addition to caching dentry (for VFS to accelerate file path name to inode conversion), but also adopted two main Cache methods: Buffer Cache and Page Cache. The former is for the read and write of disk blocks, and the latter is for the read and write of file inode. These Cache can effectively shorten the time of system calls (such as read,write,getdents).
The above is how to query the true utilization of memory in the Linux shared by the editor. If you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.