Ubuntu 22.04 Kernel Bloat

In a previous post, I’ve been looking at my “technical debt” of having a couple of services running in virtual machines that are still based on Ubuntu 18.04 which will be End-of-Live in April 2023. In the meantime I’ve started the upgrade process, which, to my surprise ended up in a kernel panic after rebooting.

While I’m at it, I thought it would be a good idea to not only upgrade the OS to Ubuntu 20.04 but in straight to 22.04 in a second step. That saves me the hassle two years down the road. While the upgrade to 20.04 worked without a problem, I was greeted by a nasty “Kernel panic – not syncing – System is deadlocked on memory” while rebooting after the 22.04 upgrade. So what’s that supposed to mean?

At first, I thought something had gone wrong during the second OS release upgrade, so I tried again by rolling back to an earlier snapshot of the VM. Same result. Fortunately, I’m not the first to experience such a kernel panic, and reports on the Internet indicated that this is caused by not enough RAM being available during the boot process. This particular machine ran on 400 MB of RAM for years, so I increased it to 512 MB to see if this would do the trick. It didn’t. So I grudgingly increased the RAM assignment of the VM to 768 MB. This made the kernel come up and the services on that virtual machine started to work again.

What bugs me a bit is that during normal operation, only 128 MB of RAM are used by programs as before (green part of the line). The same amount is used for file caching on top (yellow part of the line). So during normal operation, I’m far away from the 768 MB now required for booting the VM. That’s quite a waste. Hm, perhaps there is a kernel option to start with less memory? Perhaps something to be investigated later.