How to check for errors in RAM via Ubuntu?
Emily Wong
I have Ubuntu 11 running off a 3.6GB USB flash/stick drive. System has 4GB RAM and blank hard disk (wiped using DBAN tool).
How do I check if there are no errors in my RAM? Is there a guaranteed way to check that via some Linux command? If not, it would be great to know why.
25 Answers
By installing the memtester package, you can check your system for errors while it's still running. No need for a restart, just run that application.
To install it, open a terminal and type:
sudo apt install memtesterYou can then use it like so:
sudo memtester 1024 5This should allocate 1024MB of memory, and repeat the test 5 times.
Update
- If you have more RAM like 4GB or 8GB, it is up to you how much memory you want to allocate for testing.
- As your operating system, current running process might take some amount of RAM, Please check available free RAM and assign that too memtester.
- If you are using a 32 Bit System, you can't test more than 4 GB even though you have more RAM (32 bit systems doesn't support more than 3.5 GB RAM).
- If your system is very busy and you still assigned higher than available amount of RAM, then the test might get your system into a deadlock, and leads to system to halt, be aware of this.
- Run the memtester as root user, so that memtester process can malloc the memory, once its gets hold on that memory it will try to apply lock. if specified memory is not available, it will try to reduce required RAM automatically and try to lock it with mlock.
- If you run it as a regular user, it can't auto reduce the required amount of RAM, so it can't lock it, it tries to get hold on that specified memory and starts exhausting all system resources.
The Ubuntu Live CD includes a tool called Memtest86+ that will do just that—test your computer’s RAM. Boot up from the Ubuntu LiveCD, press and hold the Shift key, which will bring up the GRUB menu. Select Memory Test
I have found mprime to be a good tool to test memory:ftp://
(mprime can also be used to stress test your CPU)
Alternatively, use the package stress-ng to run all kind of stress tests (including memory test) on your machine.
No need for Memtest86+:
Reboot your computer:
reboot.At the GRUB boot screen (with UEFI, press Esc).
For 4 passes add temporarily the
memtest=4kernel parameter.memtest= [KNL,X86,ARM,PPC,RISCV] Enable memtest Format: <integer> default : 0 <disable> Specifies the number of memtest passes to be performed. Each pass selects another test pattern from a given set of patterns. Memtest fills the memory with this pattern, validates memory contents and reserves bad memory regions that are detected.
Reboot your computer, and at the GRUB boot screen, select memtest.
6