25.5. Setting the amount of memory manually if RAM is not recognized
In some scenarios, the kernel does not recognize all memory (RAM), which causes the system to use less memory than is installed. If the total amount of memory that your system reports does not match your expectations, it is likely that at least one of your memory modules is faulty. On BIOS-based systems, you can use the Memtest86+ utility to test your system’s memory.
Some hardware configurations have part of the system’s RAM reserved, and as a result, it is unavailable to the system. Some laptop computers with integrated graphics cards reserve a portion of memory for the GPU. For example, a laptop with 4 GiB of RAM and an integrated Intel graphics card shows roughly 3.7 GiB of available memory. Additionally, the kdump crash kernel dumping mechanism, which is enabled by default on most Red Hat Enterprise Linux systems, reserves some memory for the secondary kernel used in case of a primary kernel failure. This reserved memory is not displayed as available.
You can manually set the amount of memory.
Procedure
Check the amount of memory that your system currently reports in MiB:
$ free -mReboot your system and wait until the boot loader menu is displayed.
If your boot timeout period is set to
0, press the Esc key to access the menu.- From the boot loader menu, use your cursor keys to highlight the entry you want to boot, and press the Tab key on BIOS-based systems or the e key on UEFI-based systems to edit the selected entry options.
In the list of options, find the kernel line: that is, the line beginning with the keyword
linux. Append the following option to the end of this line:mem=xxM-
Replace
xxwith the amount of RAM you have in MiB. - Press F10 or Ctrl+X to boot your system with the edited options.
- Wait for the system to boot, log in, and open a command line.
Check the amount of memory that your system reports in MiB:
$ free -mIf the total amount of RAM displayed by the command now matches your expectations, make the change permanent:
# grubby --update-kernel=ALL --args="mem=xxM"