Raspberry Pi

How to Check the RAM on Raspberry Pi

Finding your system RAM is important since it helps you check your system performance if it slows down. The latest Raspberry Pi model includes different RAM sizes of 2GB, 4GB and 8GB. Though having a Raspberry Pi with 8GB RAM is an ideal choice for Raspberry Pi users, you can get good performance if you opt for a 4GB RAM Raspberry Pi device.

If you have recently purchased a Raspberry Pi device and are curious about checking the RAM information, follow this article, where you will find different commands to check the RAM on Raspberry Pi.

How to Check the RAM on Raspberry Pi

There are a few useful commands that can quickly provide you with the RAM information of your Raspberry Pi device. These commands are given below:

1: free Command

One of the most widely used commands to check for RAM information of Raspberry Pi is the “free” command, which is shown below:

$ free

 

This command provides you several RAM pieces of information, which are discussed below:

Total RAM Size: It is the total RAM installed on Raspberry Pi device.

Used RAM Size: It tells us about the memory currently used by the running process, and it can be calculated with the formula (total-free-buff/cache).

Free RAM Size: It shows the amount of memory not used by any process.

Shared RAM Size: It shows the amount of memory shared by multiple processes.

Buff/Cache RAM Size: It shows the amount of memory reserved by the OS Kernel and the system cache to store data and files on the system.

Available RAM Size: It shows available memory on the system needed to start a new process without memory swapping.

The above command outputs the RAM sizes in KBs and if you want to get the same output in Gigabyte or Megabyte, you can use the following command:

$ free -h

 

2: cat Command

The RAM information of the Raspberry Pi system is also stored in the memory information of a processor and you can retrieve this information through the following command:

$ cat /proc/meminfo

 

(Optional) Check Shared RAM for Processor and GPU

If you want to check the available RAM for Raspberry Pi processor and GPU, you have to execute the following command:

$ vcgencmd get_mem arm && vcgencmd get_mem gpu

 

Conclusion

Finding the RAM information is useful especially when your system performance slows down, as this will help you check the RAM utilization on your system. There are two valuable commands for checking the RAM information: the “free” and “cat” command. Both commands provide you with the RAM utilization information on your terminal; the “cat” command specifically reads the memory information file. You can also execute the “vcgencmd” command to get the shared RAM information for the processor and GPU on your Raspberry Pi system.

About the author

Awais Khan

I'm an Engineer and an academic researcher by profession. My interest for Raspberry Pi, embedded systems and blogging has brought me here to share my knowledge with others.