65

If I encounter a situation where I suspect my machine's RAM might be going bad, I might need to launch memtest86+ to check it. How can I do this using Ubuntu? Are there different methods for launching it whether Ubuntu is already installed?

* (This is intended to be a canonical question easy for new users to follow.)

muru
  • 207,228

4 Answers4

73

memtest86+ comes default with Ubuntu and you can try it from live CD or from any installation of Ubuntu. Here are the steps:

  1. While booting press (better hold down) the Shift key to bring the grub menu that looks like the following image:

    entering grub

    As you can see there are some options to choose from (this will vary from installation to insatllation), the one to look for is the third option in this screenshot i.e. Memory test (memtest86+), which will be there in the grub menu along with other options.

  2. From the grub menu go to the appropriate option to select i.e. Memory test (memtest86+) and press Enter.

    select memtest

  3. Now you will see a blue screen indicating that the memtest is running:

    memtest running

  4. Now you can press c for more configuration options:

    selecting conf options

  5. To exit from the memtest86+ session you can press Esc any time. There is no certain rule that how many passes you would run but the more the better.

Here is an image (taken from here) showing that errors were encountered i.e. the test is failing in some memory locations (pointed out in the red portion) indicating the locations might have problems. If your memory does not have any problem then you won't get any red portion.

error message

heemayl
  • 93,925
6

To perform a memory test on Ubuntu Live CD and Installed system:

  1. Turn On or Restart the system.

  2. Hold down Shift to bring up the GRUB menu.

  3. Use the arrow keys to move to the entry labeled Ubuntu, memtest86+.

  4. Press Enter. The test will run automatically, and continue until you end it by pressing the Escape key.

Allow the test to run for at least one full pass.

Faizan Akram Dar
  • 4,569
  • 1
  • 25
  • 31
2

My Ubuntu 20.04 system with 128 GB RAM became very slow after I had to reload the OS. I thought it could be a bad memory. I checked the memory using the following command,

    sudo memtester 128000 5

Doing the following solved the issue (in case it is helpful for others),
Changing the NVIDIA driver for the graphics card from opensource to proprietary did the magic. Following also helped.

    sudo vi /etc/sysctl.d/99-sysctl.conf

and add the following,

    vm.swappiness=0
vm.vfs_cache_pressure=50

2

To use Ubuntu live USB for starting memtest86+ you might have to change boot order in BIOS or press some system specific (function) key to display one time boot menu and then (at least with Ubuntu 22.04 live media) choose legacy boot (not UEFI) for the USB media. Then there is Memtest in the Grub menu. Maybe with the latest Ubuntu release it is different and you can run memtest even if you use UEFI boot for the media since memtest86+ version 6 has UEFI support.

jarno
  • 6,175