This article discusses different ways to check the size of RAM in Raspberry Pi.
4 Ways to Check the Size of RAM in Raspberry Pi
There are four useful commands to check the RAM size in Raspberry Pi, which are listed below:
- proc/meminfo
- vmstat command
- free command
- top command
The usage of each of these commands is discussed below in detail. To use any of the listed commands, open the terminal first and then go for any of the below commands you like.
1: proc/meminfo
The “proc/meminfo” file includes the system memory information and to retrieve this information, you must apply the “cat” command with the file name including the “MemTotal” command to get the total system memory.
2: vmstat command
Another command that can be used to check the detail memory status of Raspberry Pi device is the “virtual memory stats” command, which is given below:
The output displays the size of total memory along with the partitions in the form of swap memory. By default, the output displayed is in kilobytes:
3: free command
There is another simplest and most used command to check the RAM size on Raspberry Pi, which is the “free” command. You can write this command with multiple flags, including b, k,m, or g as these flags display the RAM size in bytes, kb, megabytes, and gigabytes, respectively. The output presented by each command includes the total, used, free, shared, buff/cache, and available RAM memory including the swap memory too.
To get the size of RAM in bytes, use the following command:
To get the size of RAM in kilobytes, use the following command:
To get the size of RAM in megabytes, use the following command:
To get the size of RAM in gigabytes, use the following command:
4: top command
The last command on our list is the top command, which is also used to check the system information such as CPU, RAM, and swap size:
The command displays the size of memory used by each command along with the number of users, load average, and other such details:
That’s all the four ways to check RAM size in Raspberry Pi now let’s conclude!
Conclusion
To check the size of the RAM of Raspberry Pi, four simple commands can be used: top command, free command, proc/meminfo command, and vmstat. All these commands along with their purpose are discussed in the above guidelines. The users can opt for any of these ways if they want to check the RAM size of their Raspberry Pi for any reason.