74

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.

2
  • 3
    Before booting up Ubuntu access the GRUB screen and select memtest. Sep 8, 2013 at 23:16
  • 1
    You can use memtester once booted into linux.. e.g. sudo memtester 1024 5 This should allocate 1024MB of memory, and repeat the test 5 times. Feb 6, 2016 at 22:05

6 Answers 6

98

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 memtester

You can then use it like so:

sudo memtester 1024 5

This 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.
8
  • 21
    Does this somehow mean that only a part of the memory is tested, and the rest remains untested? How can I make sure that all of the memory is tested?
    – donquixote
    Mar 8, 2016 at 6:16
  • 3
    Only that part of memory is tested! Oct 4, 2016 at 11:35
  • 6
    Upvoted, but unless I've missed something it is not possible to do a thorough test of the entire memory using memtester as the system becomes totally unresponsive (or even memtester fails to claim the full extent of memory you are asking for). So I guess memtester's use case is when you are trying to test a particular area of memory using some advanced arguments which I haven't explored. Otherwise for a through scan use UNetbootin that runs before loading the operating system and any user programs (so the responsiveness issues becomes moot). Nov 13, 2016 at 20:31
  • So,if we have 4gb/ram we should at least test 3900mb, not only 1024. Sep 2, 2021 at 12:41
  • @Goran_Ilic_Ilke, No. Its depends upon how much free RAM you have in your system. Memtester not only for checking RAM health but also for CPU, Over heating CPU related issues.
    – Raja G
    Sep 2, 2021 at 14:25
37

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

enter image description here

4
  • 20
    You don't even have to have the live CD. You can just press Shift repeatedly during startup of linux to get to the exact same menu.
    – iFreilicht
    Sep 7, 2015 at 9:06
  • 5
    The Ubuntu Live CD no longer comes with this option. Jun 26, 2019 at 16:29
  • 4
    Apparently memtest86+ is not available if your computer is running in UEFI mode ("because it is a 16-bit program"). It will not show up in grub. An alternative is memtest86 (without the "+") version, which is not FOSS but still offers a freeware version. They claim you can get it to work with grub but I could not figure it out... However it is easy to set up on a USB memory stick. See [askubuntu.com/questions/917961/…
    – bct
    Aug 7, 2019 at 7:35
  • 1
    @bct yours is the most important comment which most people will not notice. Apparently when we are working with memtest86+, we are very anxious and busy. However, we can make a bootable usb to use in UEFI system if you download the iso from memtest86.com/tech_booting-cd-dvd.html and burn it to usb drive (I used etcher). Jun 16, 2022 at 10:38
6

No need for Memtest86+ (since v2.6.27, 2008-10-09):

  1. Reboot your computer: reboot.

  2. At the GRUB boot screen (with UEFI, press Esc).

  3. For 4 passes add temporarily the memtest=4 kernel 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.
    

    screenshot

2
  • 1
    Kernel must be configured with CONFIG_MEMTEST=y
    – d4rwel
    Feb 6, 2022 at 8:34
  • @d4rwel CONFIG_MEMTEST compile option is enabled. Feb 20 at 17:00
3

I have found mprime to be a good tool to test memory. It 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.

1
  • How do I test ram with stress-ng
    – chovy
    Mar 24, 2023 at 6:25
3

For Ubuntu 22.10 and later: memtest86+ is a thorough low-level RAM test that is started from the GRUB menu after a system restart.

From version 6 on, it works on EFI systems (i.e. is a RAM tester with BIOS setting UEFI), and is FOSS.

This version is currently available for certain Ubuntu versions.

Installation:

sudo apt update
sudo apt install memtest86+

For Ubuntu 22.04 LTS: pcmemtest-86 is a fork of Memtest86+, itself a fork of Memtest86. It is no longer maintained.

Similar to those, it is a thorough low-level RAM test that is started from the GRUB menu after a system restart.

It works on EFI systems (i.e. is a RAM tester with BIOS setting UEFI), and is FOSS.

pcmemtest-86 is available from Ubuntu 22.04 LTS onward.

Installation:

sudo apt update
sudo apt install pcmemtest

In both cases, restart your system to see its entry in the GRUB menu. (If the GRUB menu does not show up when your computer starts up, press and hold shift during startup.)

2
  • The homepage say the project is unmaintained and point to Memtest86+ v6.0 Jan 22 at 20:12
  • Great to hear memtest86+ supports UEFI boots from v6.0 on! For the above mentioned Ubuntu 22.04 and lower, the package currently uses memtest86+ v5.x, and that seems to not yet work on UEFI boots.
    – neutrino
    Jan 26 at 14:58
1

Reboot your computer, and at the GRUB boot screen, select memtest.

6
  • 13
    This seems to assume that we would be seeing the GRUB boot screen at statup. I, for one, do not. Jan 5, 2017 at 20:06
  • 1
    @42- Hold SHIFT key while booting a computer. Oct 27, 2017 at 5:51
  • 6
    memtest86+ is not available for EFI systems. It's only for BIOS. You may look for a proprietary alternative for EFI.
    – Artyom
    Nov 8, 2017 at 19:49
  • For EFI systems, hold ESC while booting.
    – IronEagle
    May 24, 2019 at 20:41
  • 1
    @IronEagle still in UEFI memtest86+ is not supported currently. No chance.
    – stephanmg
    May 25, 2021 at 13:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .