In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
As Linux users, especially administrators, we need to check how much memory resources the system uses and how much memory resources are free. Since the most important thing is to check the memory resources on the server, it is best to learn the relevant commands that can help us manage the server.
This article explains the use of the following five commands to check available memory:
1. Free command
2. Vmstat command
3. / proc/meminfo command
4. Top command
5. Htop command
By using these commands, you can always ensure that there are sufficient memory resources for very important processes running on the server. For example, if you are running a Web server, you can ensure that the lack of resources does not slow down the site access, or that the site does not stop running completely.
We ran the commands and procedures mentioned in this article on the CentOS 7.5 system, as well as on Ubuntu Linux.
To see the memory usage, we are using the Linux command line, the terminal application. You can open the terminal through the system Dash.
Method 1:free command
Since the free command is the most widely used and undoubtedly the most useful, we will first mention its usage. This command is used to check information about system RAM usage. Here are the commands you will enter in the terminal:
The available column represents the available memory.
The column of used in the Swap entry is 51, which means it uses 51m and the free portion is 1996m.
Method 2:vmstat command
To view memory statistics through the vmstat command, you can use it in the following ways:
The s tag provides detailed statistics about memory usage.
You can view the available memory and available swap memory entries in the output to indicate the available memory in the system.
Method 3:/proc/meminfo command
The following command extracts memory-related information from the / proc file system. These files contain dynamic information about the system and kernel, rather than real system files.
This is the command for printing memory information:
The output of this command is similar to the vmstat command. You can easily view the free memory in the MemFree results and the available swap memory in the SwapFree results.
Method 4:top command
The top command is used to print the system's CPU and memory usage. You can use this command as follows:
In the title of the output, you can see the KiB Mem and Kib Swap entries, which allow you to check the used and available memory resources.
Method 5:htop command
Just like the top command, the htop command analyzes your CPU and memory usage in detail. If you do not have htop,Ubuntu installed on your system, you can install it by updating the abt repository with the following command:
$sudo apt-get update
Then enter the following command
$sudo apt install htop
Use the following command to install under CentOS:
[linuxidc@localhost ~] $sudo yum install htop
After installing htop, you only need to print the required information using the following command:
[linuxidc@localhost ~] $htop
The Mem (Memory, or RAM) and Swp (Swap) entries in the title represent the used and total memory, which allows you to calculate the available memory on the system.
Using the commands we mentioned in this article, you can monitor the system process memory. You can not use GUI at all, and you can still check memory usage on personal computers and servers.
These are the details of several ways to check the amount of available memory in linux. Please pay attention to other related articles for more!
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.