Monitor RAM/Memory on Linux

Memory (RAM) is known as an important component on the server to make sure that the server is running smooth and the running process could run in normal state. With Linux environment, it come with several tool to allow server administrator to check it’s memory such as free, top, vmstat, etc.

Today, Mick Genie will teach you on how to monitor them through several component that easily to understand by a server administrator or end user.

1. top – top command use to monitor the server performance, information, etc in real time. The rows of the memory and swap show that the total available, used and free memory and swap for your server.

2. /proc/meminfo – by open this file, it will show you the actual server properties information such as it’s memory, virtual memory, buffer, etc.

cat /proc/meminfo

3. free – one of the easier way to monitor and check the available memory from the server where you could use several command to control your needed information.

free -m
– use to monitor the physical memory

free -m -t
– use to monitor the physical memory plus it’s total usage

4. sar – sar command included ‘sysstat’ used to collect system activity information and saves it in a file before displaying it on a standard output.

You may use the command as below to show memory/swap/buffer information with human readable.

sar -r