How To Check Memory Usage Of Linux? – POFTUT

How To Check Memory Usage Of Linux?


Linux operating system is popular with its efficient memory usage. Also Linux operating systems provide a lot of details about their memory usage. In this tutorial we will look into details of the memory usage information. There are different ways to get memory usage information. Alternatively we can call this RAM usage. Because in the static most of the information is  about RAM

Get Information With free

free is very easy and lane command to get basic information about Linux operating system memory usage. The free command provides very little information about memory usage but it is very useful.

$ free
Get Information With free
Memory informatoin with the free command
  • total is the total memory size as byte unit.
  • used is the used memory as byte unit.
  • free is the free or unused memory size as byte unit.
  • shared is the multiple processes shared memory size as byte unit.
  • buff/cache is the cache or buffer memory size as byte unit.

As we can see the memory sizes are displayed as byte unit. This can be hard to read. The -h option of the free command can be used to print more human friendly information about memory sizes. This will display the total, used, free, shared, buff memory size as Gigabyte with the Gi extension.

Human Readable Format

We can show memory usage with free more human readable by changing KB to GB like below. -h parameters makes this magic.

$ free -h
Human Readable Format
Human Readable Format

Display In Megabyte Format

By default free command print information about the memory in byte format. It can be hard to read in general. We can print this information in megabyte or MB format with the --mega option.

$ free --mega
Display In Megabyte Format
Display In Megabyte Format

Display In Gigabyte Format

By default free command print information about the memory in byte format. It can be hard to read in general. We can print this information in gigabyte or GB format with the --giga option.

$ free --giga
Display In Gigabyte Format
Display In Gigabyte Format

Getting Information With top

top command is very detailed and interactive tool to get memory usage information.

Getting Information With top
Getting Information With top

top is a real time tool so it will update table by default in 2 seconds. To list  processes with top according to memory usage use 

Getting Information With top
Getting Information With top

gnome-shell is number one process in memory consumption with %15.3 and other processes listed descending.

LEARN MORE  Linux Top Command- Monitor Linux System Resources Cpu, Memory, Network

We can see at the top KiB Mem: line there is existing memory size and current general usage.

free command
free command

How To Check Memory Usage Of Linux? Infografic

How To Check Memory Usage Of Linux? Infografic
How To Check Memory Usage Of Linux? Infografic

Leave a Comment