Raspberry Pi

Check Raspberry Pi RAM Usage Using ps_mem

ps_mem is a command-line utility for finding the RAM usage on the system. It calculates the amount of RAM (private and shared) utilized by each program on your system. The tool requires a Python interpreter to execute the script and display the terminal’s RAM usage.

If you are a Raspberry Pi user, you can install ps_mem on your system through this article’s guidelines.

Check Raspberry Pi RAM Usage Using ps_mem

You can install ps_mem on Raspberry Pi through the following steps:

Step 1: Download ps_mem Python Script

First, download the ps_mem Python script from the GitHub on Raspberry Pi through the following command:

$ sudo wget -O /usr/local/bin/ps_mem https://raw.githubusercontent.com/pixelb/ps_mem/master/ps_mem.py

Note: The above command downloads the script file in “/usr/local/bin” location.

Step 2: Make the ps_mem File Executable

You must run the following command to enable the execute permission for the ps_mem file on your Raspberry Pi system.

$ sudo chmod a+x /usr/local/bin/ps_mem

Step 3: Confirm ps_mem Installation

Now, you can run the following version command to ensure ps_mem successful installation on the Raspberry Pi system.

$ ps_mem --version

Run ps_mem on Raspberry Pi

To check for Raspberry Pi RAM usage on Raspberry Pi, use the following command now:

$ sudo ps_mem

Note: In the above output, the private memory is the system committed memory that can only be used for the process. While the shared memory can be shared with other system processes.

You can also command given below to check for RAM and Swap usage on the Raspberry Pi:

$ sudo ps_mem -S

For further help, execute the following command to enter help section:

$ sudo ps_mem --help

Remove ps_mem from Raspberry Pi

You can remove ps_mem from the Raspberry Pi system anytime using the following command:

$ sudo rm -rf /usr/local/bin/ps_mem

Conclusion

ps_mem is an effective command-line utility for finding the RAM usage on the Raspberry Pi system. You can install this utility by downloading the Python script file from GitHub and then making the file executable. After that, you can run the “ps_mem” command to check for RAM usage 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.