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.

MrChips
  • 993
  • 1
  • 5
  • 11

1 Answers1

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!

MrChips
  • 993
  • 1
  • 5
  • 11