Memtest86 is primarily a RAM testing tool that runs in its minimal environment, and due to this, no drivers or any background processes interfere. Furthermore, it is suitable when the system is getting unstable, even during login. This guide will discuss two ways to run memtest on Ubuntu.
1: Through Ubuntu GRUB Menu
The first method to check the memory (RAM) of Ubuntu using the memtest utility is via its GRUB menu, which primarily appears on system startup. In the GRUB menu, select any of the options for memory tests.
The details for both options are as follows:
Memory test (memtest86+x64.bin)
- Execute MemTest86+ in the normal display mode.
- The output is shown on the system’s graphical/text console
Memory test (memtest86+x64.bin, serial console)
- Sends its output also over a serial port and is also shown on the normal display.
- This is used for remote diagnostics or when connected to the machine via a serial cable (common in servers, embedded systems, or headless setups).
Once memtest86 is selected, the test will start automatically, and its progress alongwith any errors found, will be displayed:
Once the test is completed, a banner of pass will be displayed, and the next iteration will begin automatically. To stop the test, press the ESC key to exit the test:
Note: MemTest86 / MemTest86+ via GRUB or boot media tests all installed RAM, because it runs outside the operating system before anything reserves memory.
2: Through Memtester Application
Another way to test the RAM of the Linux operating system is via the memtester application, which can be installed using apt:
sudo apt install memtester
To test the RAM, simply enter the size and the number of iterations using the syntax below:
sudo memtester [memory-size-to-be-tested] [number-of-iterations]
Here in the image below, I have checked 300 MB for two times:
Once all the iterations are completed, the test will terminate by itself:
Furthermore, to check the memory status on Ubuntu, execute the command below:
free -h
For further information about the memtester application, visit Ubuntu’s Manpages.
Note: The memtester CLI only tests the specified amount of RAM, which must be from the unused/free memory available while the operating system is running. It cannot touch memory already in use by the system.
Conclusion
There are two ways to check the RAM for Ubuntu or any other Linux operating system: one is via the GRUB menu, and the other is through the memtester application. The primary difference between the two is that one checks the whole RAM, and the other checks only the unused or free memory of the system.