Raspberry Pi LogoIf you followed my articles about broadcasting system vitals from your Raspberry Pi using Python and are using a Raspberry Pi Model B, you will probably notice that your Arch Linux Pis are probably showing that they only have 184 MB of RAM installed. This is not a mistake in the code. If you are using the defaults from the Arch Linux image for your Raspberry Pi Model B, then your Pi really is returning 184 MB. This is because the Pi has memory dedicated to both your CPU and your GPU. In fact, more than half of your memory is dedicated to your GPU. If you are running a media center on your Pi or running custom applications on the GPU like in the case of my home automation system, then this is OK. However, if you aren’t doing anything silly and don’t have a need to use the video card in your Raspberry Pi (ie. you only ssh into your Pi), then this article will show you how to lower the amount of memory that is dedicated to your GPU which in return will free up memory for your CPU.

WARNING: Changing the allocated memory can cause your Raspberry Pi to stop working. It is advised to create a backup image of your SD card before continuing.

Before we get started with changes, let’s first take a look at how much memory the Pi has dedicated to the CPU. You can do this by running the following command:

free -m

If you are running the Raspberry Pi Model B, it should be reporting that you only have 184 MB total.┬áTo change the amount of memory dedicated to your Pi’s GPU and to allocate more memory to your CPU, type the following command:

nano /boot/config.txt

Scroll to the bottom of that file and you will see the following 2 lines:

gpu_mem_512=316
gpu_mem_256=128

The first value says that if your Pi has 512 MB of RAM (as in you are using the Model B), then it wants to dedicate 316 MB to the GPU. The second value says that if your Pi has 256 MB of RAM (as in you are using the Model A), then it wants to dedicate 128 MB to the GPU. Comment out both of these lines by adding a # at the beginning of each line. Then, add the line below so that your file now looks like this:

#gpu_mem_512=316
#gpu_mem_256=128
gpu_mem=16

Press Ctrl+X, type “Y”, and press enter to save your changes and close the file. Restart your Pi by typing “reboot” and pressing enter. After your Pi has restarted, re-run the “free -m” command from above and you will see that your Pi is now reporting that it has 479 MB of RAM (minus the 16 MB of RAM dedicated to your GPU and assuming you’re running the Model B).

Thank you for your interest in my site. If you find the information provided on this site useful, please consider making a donation to help continue development!

PayPal will open in a new tab.
$2.00
$5.00
Other

Related Posts

Tagged with:  

Leave a Reply