Top 3 Commands To Check Memory In Linux

Top 3 Commands To Check Memory In Linux

 

If you are using a system and would like to determine its physical memory without physically checking, you can use the command line.There are number of programs, tools, and utilities which you can use to examine the memory status of your system. This article talks about the frequently used 3 commands.

1. top

The top command provides a dynamic, real-time view of a running system. Included in that system summary is the ability to check memory usage on a per-process basis.
Bonus Tip: top -o %MEM This memory friendly command will sort all processes by memory used.

2. free

The free command is the most simple and easy to use and check memory usage on linux. The free command outputs:

  • Total Memory,Used Memory,Free Memory.
  • Total amount of swap memory in the system.
  • Used caches & buffers memory.

Bonus Tip: To show the memory unit to human-readable format free -h

3. /proc/meminfo

The/proc/meminfo is used by to report the amount of free and used memory (both physical and swap) on the system as well as the shared memory and buffers used by the kernel. You can use the cat or less to dispaly the vales.
Example: cat /proc/meminfo

Bonus Tips

To list top 10 Memory consuming processes with user.
ps -e -o pmem,pid,user,args|sort -k1 -nr|head -10

Find out the top 10 memory consuming process.
ps -auxf|sort -nr -k4|head -10

Virtual memory statistics reporter command.
vmstat -s


Technology Python Programming Entertainment Python3 Linux Web-development Linux-mint Centos 7 Book
ziabs @ 28 Jun 2020