Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Using top and free commands to view the free memory in the system in CentOS

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail about CentOS in the use of top and free commands to view the free memory in the system, the content of the article is of high quality, so the editor will share it for you to do a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

So what you see when you execute the top command

[root@linuxzgf ~] # top

Mem: 8174492k total, 7124268k used, does not mean that your application has used 7.1g of memory, this 7.1g contains: application memory + buffer + cached memory, need to be checked with the free command.

Here is an example (in MB):

[root@linuxzgf] # free-m

Total used free shared buffers cached

Mem: 7982 6811 1171 0 350 5114

-/ + buffers/cache: 1346 6636

Swap: 16935 11 16924

[root@linuxzgf ~] #

In this example, the application uses only 1346MB memory, and 6636MB free memory is available.

Some simple calculation methods:

Physical used memory = actual used memory-buffer-cache

= 6811m-350m-5114m

Physical free memory = total physical memory-actual used memory + buffer + cache

Application free memory = total physical memory-actual used memory

Application used memory = actual used memory-buffer-cache

Original explanation: go to the Internet:

The basic principle of Linux is that no resources should be wasted. So the core uses as much RAM as possible to cache information from local and remote file systems. When the system does read and write operations, the data related to the currently running process will be stored in RAM as much as possible. The cache reported by the system is the sum of buffering and page caching. Instead of being reclaimed at the end of a process (you may soon start another process and need the same data), the cache is recycled on demand-for example, when you start a process that requires a lot of memory, the Linux core reclaims the cache from memory and allocates the resulting memory to the new process.

About CentOS in the use of top and free commands to view the free memory in the system is shared here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report