Out Of Memory Error during Loading initrd
initrd (initramdisk) is too large to fit into memory during early boot. Reducing the size helps.
sudo make INSTALL_MOD_STRIP=1 to reduce size of kernel modules in order to reduce the size of initrd.
Problem: Fail to boot because of OOM error.
Loading Linux 4.19.237 Loading initial ramdisk error: out of memory Press any key to continue
Solution: Reduce the size of initrd
That’s because the initrd is too huge for early boot. It is directly affected by the size of total kernel modules. So reducing the size of kernel modules would help reducing the size of initrd. One way to do that is by stripping the unnecessary symbols of kernel modules.
sudo make INSTALL_MOD_STRIP=1 modules_install sudo make install
- The man who proposed and solve this issue: Out of memory on "Loading initial ramdisk" after kernel upgrade (4.15 to 4.19) on Ubuntu 18 - Unix & Linux Stack Exchange
- The instructions to strip and rebuild initrd: How to reduce the size of the initrd when compiling your kernel? - Unix & Linux Stack Exchange