How to check available memory in Ubuntu
Linux, BSD and * nix operating systems in general, provide users with many options to view information within the system. Just open the terminal and type cat / proc / cpuinfo, cat / proc / meminfo or cat / proc / net / wireless . Although the data found through these Linux commands is quite comprehensive, they are not easy to read at all. Let's see some utilities that display memory usage in a more readable format in the following article!
Note: Although the instructions here are for Ubuntu, you can read it for most other Linux distributions.
How to check memory on Ubuntu?
- Graphic utilities to check RAM usage
- Gnome System Monitor
- Conky
- Check the free memory with the command line utilities
- 'Free' utility
- 'Top' and 'htop' utilities
Graphic utilities to check RAM usage
By default, Ubuntu includes an application called System Monitor. Users can access this tool by clicking the Show Applications button at the bottom left and then entering from the monitor to search for the application.
If it is not installed on the distribution you are using, you can install it with:
sudo apt install gnome-system-monitor
Gnome System Monitor
This application has 3 tabs to view information about processes, resources and file system. Tab Process is very useful. Not only to see memory usage, users can also right-click programs and change their CPU usage priority, forcing programs to close, etc.
In the Resources tab , users can view information about CPU load, memory usage and Swap (virtual RAM), as well as network activities.
Sometimes users may want to monitor memory usage when opening or using programs. Right-click the bar (title) at the top of the memory usage window and select Always on Top . This will keep the window displayed all the time, even if you open a full screen program. You can use the same trick with htop or other utilities in the terminal window.
Conky
Another popular solution for tracking system resources is Conky. It is an integral part of the desktop. It is always active and allows users to quickly see information about system resources at any time. Please install it with the following command:
sudo apt install conky-all
By default, it displays on the left side of the screen and will be superimposed on the application bar. Therefore, move it to the right:
cp /etc/conky/conky.conf ~/.conkyrc && sed -i 's/left/right/' ~/.conkyrc sed -i 's / left / right /' ~ / .conkyrc
Open a terminal and enter:
conky
Of course, the default settings are very basic, so they often don't look very nice. But this utility is very flexible and can display many other system indicators. Moreover, some themes created by other users make Conky very beautiful. You can apply if you want. For more on how to customize Conky, please refer to the article: How to use Conky to make Linux more awesome.
Check the free memory with the command line utilities
Sometimes the graphical user interface is not available, for example on servers. In such cases, there are command line utilities that can display information about memory usage.
'Free' utility
Open a terminal and enter the following command:
free -h
Display results can be confusing for new users who have moved from Windows to. Here, 'free' does not mean the amount of free memory that applications can use. That's because 'buff / cache' . When the operating system reads a file from a hard drive or SSD, it will hold the data of that file in RAM. In this way, when you need to read the file again, the operating system can skip accessing the storage device and read directly from RAM. This will be much faster. That's why if you open the browser, close it, then open it again, the browser will load much faster.
Although the buffer and cache can use almost all RAM, users can still consider the available memory. That's because as soon as an application needs more RAM, some data buffer / cache will be immediately deleted to free up memory for the required program.
Therefore, the most important fields here are 'used' and 'available'. 'Used' reflects the amount of RAM that the program is using and 'Available' indicates how much RAM is available for the required application. This is really the amount of RAM left. Concepts 'free,' 'used' and 'available' are also used in some graphics applications.
'Top' and 'htop' utilities
Another command, usually available on Linux systems, is 'top'. You can type 'top' in the terminal to open it. Press q to exit. But, as you can see in the illustration below, it's a bit hard to read.
This is why so many users prefer a more friendly version, called htop. First, install this utility:
sudo apt install htop
Then start the program.
htop
As you can see, htop is much easier to read, thanks to the use of colors and column charts. The first and the front columns are numbers 1, 2, etc., reflecting the use of CPU core. In the Memory column, you can pay attention to the green lines. The remaining two lines are blue and brown, reflecting the buffer and cache of the file as well as the directory. As mentioned in the previous section, they can be deleted from memory at any time to free up parts of RAM that can be used.
Besides using keys to interact with htop, you can also use the mouse cursor to click on the displayed elements.
These are the most common applications for displaying Ubuntu memory usage. You can sort processes according to the amount of RAM they use. You may find that you do not need some applications that take up a lot of memory and have the right to remove them from your system.
See more:
- How to manage memory to restrict Linux to use too much RAM
- Learn about swapping Linux memory space
- How to use Memory Cleaner to release RAM
You should read it
- What's New in Ubuntu 21.10?
- Why is Ubuntu LTS preferred over regular distros?
- What's new in Ubuntu 18.04 LTS just released?
- How to prolong the life of Ubuntu 18.04 installation with Ubuntu Pro
- What is the difference between Ubuntu Desktop and Ubuntu Server?
- How to upgrade Ubuntu from the command line
- Ubuntu 21.04 users need to update the system ASAP
- 5 things to do after upgrading to Ubuntu 22.04 LTS
- 5 Reasons Ubuntu Cinnamon Is Better Than Other Ubuntu Versions
- Instructions for installing Ubuntu on VMware Workstation - Part 1
- 7 reasons to upgrade to Ubuntu 23.04
- Ubuntu 19.10: Roadmap for release & planned features
Maybe you are interested
How does stress damage memory and cause anxiety disorders?
The world's 'stupid' bird, at the moment of life and death it 'loses its memory'
Nvidia launches RTX 4070 version with 'super fast' GDDR6 memory
Nvidia is developing a line of AI GPUs with 144GB HBM3E memory
3 Ways to free up Google Drive space, increase memory
Samsung begins mass production of 'most advanced' 12nm DDR5 memory chips