6

I have looked everywhere (both on and off StackExchange) for this but cannot get an answer:

I have a Raspberry Pi Zero W, which has 512MB of RAM total. I am running it headless, so I want to maximize available RAM. I have set gpu_mem=16 in the \boot\config.txt file and have rebooted the device.

When I run free -h I get the following output:

total used free shared buff/cache available Mem: 370M 20M 299M 2.6M 50M 300M

When I run vcgencmd get_mem arm && vcgencmd get_mem gpu I get:

arm=384M gpu=128M

This seems to be telling me that the GPU memory is still set to 128MB.

How can I properly free up this memory for general use by my applications?

Thanks ahead of time for any help you can give here.

6
  • 1
    Have you installed the official Raspbian image or the NOOBS image on your miniSD card? Are there any hdmi_ configuration options in your /boot/config.txt ? I believe the default gpu_mem is 64M not 128M. Commented Nov 22, 2017 at 4:50
  • That's strange, considering it works perfectly as expected on my Pi Zero W, even if I go all out with the hdmi_* options. To ensure that it isn't an issue of formatting or a CRLF in your /boot/config.txt, does the problem persist if you enact the change via sudo raspi-config?
    – jdonald
    Commented Nov 22, 2017 at 4:55
  • RubberStamp - I am on Raspbian 'Stretch' as of the time of this writing with all of the firmware up-to-date. All hdmi_ entries in /boot/config.txt are commented out (this is a completely headless install). The gpu_mem setting is 16 (the minimum).
    – MrChips
    Commented Nov 22, 2017 at 6:53
  • 1
    jdonald - I tried updating the GPU split via raspi-config just to be sure, and everything is still coming up the same, so it's not a formatting issue.
    – MrChips
    Commented Nov 22, 2017 at 6:58
  • is the value the same in raspi-config and in config.txt file ?
    – guyd
    Commented Nov 22, 2017 at 9:14

1 Answer 1

5

Thanks to the forums over on raspberrypi.org I was able to find out the answer to this, so I am sharing it here for future reference...

ANSWER: The 128M of GPU RAM is still being reserved because I have the Raspberry Pi Camera enabled. The camera requires a minimum of 128M of GPU RAM to be held aside in order to function properly. This overrides the gpu_mem=16 setting in the \boot\config.txt file.

Going Deeper:

If you see this happening on your Pi, you can validate if it's the camera by going into the \boot\config.txt file and looking for the setting start_x=1. If that setting exists, your camera is enabled (even if you don't have one connected!). To turn it off, either set it to start_x=0 or comment it out, then reboot. You should see your GPU RAM allocation go back to whatever value you placed in the gpu_mem setting. Of course, then you won't have camera access, but hey, that's the deal, right?

Good luck, and thank you all for your help!

1
  • THANK YOU so much, exactly what was wrong w/ my setup. Commented Jan 26, 2021 at 22:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.