Score:0

Out of memory at early stage of boot

ve flag

I have a Ryzen 9 with 32 GB of RAM. Often, just after the GRUB menu, this message appears in the top left corner of the screen:

Error: out of memory
Press any key to continue...

Pressing a key leads to successfully boot Ubuntu 22.10. It's not a very big deal, but:

  1. when powering-on the PC from remote it's a serious issue since it requires a user-interaction to continue

  2. surely it cannot be true, so I wonder why it thinks it does not have enough RAM available

  3. most important, I'm afraid this can hide some other issues

I've checked in dmesg and I found nothing related. I bet this happens even before it begins to log messages.

I also have a Windows installation and this message never appears when booting Windows. Hence I assume is related to Ubuntu only.

David avatar
cn flag
Do you have a swap file configured on the OS?
ve flag
@David, no I don't. Should I? I read that with plenty of RAM is not mandatory
David avatar
cn flag
No it is never mandatory.
Hannu avatar
ca flag
Opinion: error messages should always have a source / generator indication, anything else is sloppy programming.
Score:2
in flag

The memory does not necessarily refer to the full 32GB of RAM, but the lower portions of it that are used at boot time. For AMD-based systems running kernel 5.19 or newer, I’ve found it’s necessary to add an amd_iommu option to grub.

Here’s how:

  1. Open Terminal (if it’s not already open)

  2. Open the Grub configuration file for editing:

    sudo {editor of choice} /etc/default/grub
    

    Note: Be sure to replace {editor of choice} with your editor of choice.

  3. Find the line that starts GRUB_CMDLINE_LINUX_DEFAULT and add the following:

    amd_iommu=off
    

    This may give you something like:

    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash amd_iommu=off
    
  4. If you have an option for just iommu, this should be removed.

  5. Save the file and exit the editor.

  6. Update the boot loader:

    sudo update-grub
    
  7. Reboot.

You should be good to go from here.

ve flag
In these two days I rebooted my PC several times after adding the new option. Unfortunately, the error message still appears sometimes.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.