Why does Ubuntu Server 21.10 use so much ram?

I have a Pi 3B I have been using to run a few small servers (Plex, PiHole, and a small Calibre book server), and had been doing so with Raspbian. The Plex media files are stored on a separate NAS device, so it isn’t serving the files directly (so are the books, although I believe Calibre makes a copy of the books on import). Last week I upgraded Raspbian to Bullseye via command line and was having some quirks (I know, it wasn’t recommended to do it this way, but I figured if I would end up having to reinstall anyway I’d try the upgrade path), so I grabbed a separate card and gave Ubuntu Server 21.10 a try.

Initially things ran better, and I was more “at home” as I am more familiar with Ubuntu overall, but I am now finding that Ubuntu uses up so much more ram! Raspbian seemed to only use between 300 and 500 MB of ram to run all of the servers (Plex, PiHole, Calibre), and that was even with the desktop and VNC active.

On Ubuntu, I am running completely headless, no VNC server, no desktop installed, with the same Plex, PiHole, and Calibre servers running, but it is getting up to 600 to 900 mb at any given moment and will frequently lock up to the point where I can’t SSH in and need to hard reboot.

Is there a way to slim down Ubuntu Server 21.10 for the Pi, or should I either look at going back to Raspbian lite or just bite the bullet and swap my 3B for my only 4B (with 4GB ram)?

Right now the 4B is the one I tinker with, so I’d hate to lose it by making it the full-time server, although it might let me install Home Assistant alongside the other servers I have going and actually get more use out of a single server. I also run Motion eye off 2 Pi Zero Ws with cameras and a Pi Zero W 2 as the viewing server, but would like to put the W2 in a new project, so moving the viewing server over to the main server would be ideal, or just pipe the videos directly into Home Assistant.

Thoughts on slimming down Ubuntu, going back to Raspbian, or just going for the 4b?

Does htop show you what process(es) are using so much of your RAM? You could also try shutting off your services and checking the memory use then to help narrow it down.

We’re running Raspberry Pi OS Lite (Still on Buster for now) for our PiHole and NUT and it uses a whole 64MB, vs 105MB on our cluster RPi 4Bs that have Manjaro-ARM Minimal, so I think probably the Raspbery Pi team really went the extra mile and trimmed down their OS so that it would run nice on older or smaller RPis.

Thanks for the reply!

My Pi somewhat answered the question for me–it locked up, again, for like the third time today, so I just swapped back to my old Raspbian sd card and spent some time getting things tweaked to work again (i.e. reinstalling desktop to have the option of VNC). I can’t get Calibre working again on the newer Bullseye install, but may just compile from source to get it back…

I do still have the Ubuntu install on another sd, so out of curiosity may either put it back in the Pi3 to test and optimize when I have a bit more time, or may just try putting it in the Pi4 and see if it is worth the added hardware.

i tend to stick with Raspberry Pi OS Lite with the Command line interface and manage the PI’s i have via SSH. the other distro’s in my experience do use more RAM for various reasons, the raspberry PI team seem to have done a great job optimising their own OS and i stick with that for all my PI’s. One thing i would do is run the htop utility and sort the processes by RAM usage, that way you can track what processes are consuming your RAM… start htop and press F6 and sort by PERCENT MEM…this will show you in real time RAM usage of processes.

I poked around in there and don’t really see anything out of the ordinary, other than maybe snapd and a few other services. Guess it was just an optimization thing with Raspbian.

Ended up going back to Ubuntu 21.10 and putting my server on the Pi4, then got HomeAssistant up and running, so it consolidates some of my other servers and VMs into a more efficient ARM based system instead of running in a VM or a separate x86 box I occasionally hook up to mess with (but don’t want to keep running all the time because it is loud, hot, and power hungry).

1 Like