#FREE MEMORY LINUX FREE#
The Mem (Memory aka RAM) and Swp (Swap) entries in the header indicate the used and total memory through which you can calculate the free memory available on your system. Once htop is installed, you can simply use the following command to print the required information: $ htop
#FREE MEMORY LINUX INSTALL#
If you do not have installed htop on your system, you can install it by first updating your abt repositories through the following command: $ sudo apt-get updateĪnd then installing htop by entering the following command as sudo: $ sudo apt install htop Just like the top command, the htop command also gives a detailed analysis of your CPU and memory usage. In the header of the output, you can see the KiB Mem and Kib Swap entries through which you can check the used and free memory resources. You can simply use this command as follows: $ top The top command is used to print CPU and memory usage of your system. You can easily view the free memory in the MemFree result and the free swap memory in the SwapFree result. The output of this command is similar to the vmstat command. This is the command you will use to print memory information: $ cat /proc/meminfo These files contain dynamic information about the system and the kernel rather than the real system files. The following command extracts memory-related information from the /proc file system. You can view the free memory and the free swap memory entry in the output, indicating the available memory in your system. The s flag provides detailed statistics about memory usage. In order to view memory statistics through the vmstat command, you can use it in the following manner: $ vmstat -s The used column in the swap entry is also 0 which means that it is all unused and thus free. The available column indicates the available memory.
The m flag means that the information will be displayed in MBs. Here is the command you will enter in the Terminal: $ free -m This command is used to check information about the RAM usage by your system. Since the free command is the most widely used and without any doubt the most helpful, we will mention its usage first.
You can open Terminal using either the system dash or the Ctrl+alt+T key combination. To view memory usage, we use the Ubuntu command line, Terminal application. We ran the commands and procedures mentioned in this article on an Ubuntu 22.04 LTS system. For example, if you are running a web server, you can be sure that a lack of resources will not slow down access to the website or even crash the website.
With these commands, you can always be sure that there are enough memory resources for the very important processes on your servers. In this article, we will explain how you can check the available memory using the following 5 commands: Since it is most important to control the memory resources on servers, it is best to learn the appropriate commands that can help us manage servers. For example, servers usually work on the shell, and there is no graphical user interface at all. We also know that most administrative tasks are better done from the Linux command line than from the graphical user interface. As Ubuntu users, especially as administrators, we need to check how much RAM resources our system uses and how much of it is free.