How to check memory on Debian Linux

How do I check free and used memory on Debian Linux system using the command line option? Random Access Memory (RAM) is the memory in the computer that is used to store running process and data. RAM provides faster data access as compared to the disk drive. This page shows how to find out the amount of free and used memory in the Debian Linux system.

Check memory Debian Linux

The procedure to check memory is as follows:

Open the terminal app or login to the remote Debian server using ssh command:ssh user@server-name-here

Type the free command to see memory in mebibytes:free -m

You can also /proc/meminfo:cat /pro/meminfo

Let us see all commands to check memory usage on Debian Linux cloud or bare metal server.

1. free command

Display the amount of memory in bytes:free -b Show the amount of memory in mebibytes:free -m Get the amount of memory in megabytes:free --mega Find the amount of memory in gibibyte:free -g Want to see the amount of memory in gigabytes? Pass --giga option as follows:free --giga Pass the -t option to get totals info about memory:free --giga -tFig.01: free command in action

2. /proc/meminfo

Use cat command as follows:cat /proc/meminfoThis file reports statistics about memory usage on the system. It is used by free 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

3. top command

Just type top command:toptop command displays Linux processes including CPU and memory/swap usage

htop command

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

Your support makes a big difference:

I have a small favor to ask. More people are reading the nixCraft. Many of you block advertising which is your right, and advertising revenues are not sufficient to cover my operating costs. So you can see why I need to ask for your help. The nixCraft takes a lot of my time and hard work to produce. If everyone who reads nixCraft, who likes it, helps fund it, my future would be more secure. You can donate as little as $1 to support nixCraft: