In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail what are the management tools for analyzing memory usage under the Linux system, and the content of the article is of high quality, so the editor will share it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.
There are many ways to get information about the memory installed on a Linux system and see how much memory is in use. Some commands show a lot of detail, while others provide concise (but not necessarily easy to understand) results. In this article, we will introduce some more useful tools to help you check memory and its usage.
However, before we go any further, we would like to review some basic knowledge. Physical memory is different from virtual memory, which includes disk space configured as a swap. The swap may include partitions reserved for this purpose, or files created to add to a new swap-when it is not practical to create a new partition. Some Linux commands provide information on both aspects.
The swap expands memory by providing disk space that can be used to hold inactive pages that are moved to disk when physical memory is full.
One file that plays a role in memory management is / proc/kcore, which looks like a normal (though very large) file, but it doesn't take up disk space at all. Like all files in / proc, it is a virtual file.
Interestingly, the two systems queried below do not have the same amount of memory installed, but the size of / proc/kcore is the same on both systems. The first system has 4 GB of memory installed, and the second has 6 GB.
The size of the file indicates the amount of virtual memory available (maybe plus 4K), which may be untenable. This number indicates that the virtual memory on these systems is 128 TB! This number represents the amount of memory that a 64-bit system can address, not the amount of memory available on the system. This number can be derived by calculating in the following ways, plus 4K:
Another more humane command to check memory is the free command, which provides an easy-to-understand memory report.
Using the-g option, free reports these values in gb units.
Using the-t option, free displays the same value as when there is no option (don't confuse-t with tb), but adds a line at the bottom of the output.
Of course, you can also use both options at the same time.
If you want the answer to "how much RAM is installed on this system", you may be disappointed with this report, which is the same as the system with 6GB RAM shown in the example above. This does not mean that the report is wrong, but the system's view of the memory it has. The free command also provides the option to update the results every X seconds (10 seconds in the following example).
Using the-l, the free command provides high and low memory usage.
Another way to view memory is the / proc/meminfo file. Similar to / proc/kcore, this is a virtual file that provides a useful report on how much memory, free memory, and available memory is installed. Obviously, leisure and availability do not mean the same thing. MemFree for unused RAM,MemAvailable is an estimate of the memory available to start a new application.
If you only want to view the total memory, you can use one of the following commands:
The DirectMap entry breaks down the information on memory into categories.
DirectMap4k represents the amount of memory mapped to standard 4k pages, while DirectMap2M represents the amount of memory mapped to 2MB pages.
The getconf command tends to provide more information.
You can use the commands shown below to reduce the output to specific content, and you can get the same information as some of the commands above.
This command calculates memory by multiplying the values in the first and last lines of the output, as follows:
By doing the calculation independently, we can see how this value is derived.
Another command that the output is very easy to understand is that the numbers in the first five lines of the top,top output show memory usage.
The final command will answer succinctly, "how much RAM is installed on this system?"
Depending on the details you want to see, the Linux system provides a number of options to see how much memory is installed on the system, how much memory is used, and how much memory is available.
On the Linux system analysis of memory usage management tools which are shared here, I hope that 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.
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.