RAM modules installed in motherboard slots with testing equipment visible
Linux Troubleshooting
William  

How to Run Memtest86 for Reliable RAM Diagnostics

For any memory fault you actually need to diagnose, the only memtest software worth trusting is a bare-metal tester like MemTest86, Memtest86+, or a paid Windows option like Karhu, run for multiple passes with nothing else booted. Every in-OS tool shares the same address space it is trying to verify, so it can only catch the loudest, most catastrophic failures. A single clean pass proves nothing. It means you did not stress the RAM long enough, not that the RAM is good.

I have burned a full night chasing a "clean" memory report before, only to watch the same box throw a kernel panic under load an hour later. The tester was fine. The test was the problem.

What a memtester actually does to your RAM

At its core the job is simple: write a known pattern into a memory cell, read it back, and compare. If the value changed, the cell or the path to it is faulty. That is the whole write-read-verify loop, repeated across billions of addresses with different patterns.

The patterns matter more than the loop. A good tester walks all-ones, all-zeros, and alternating bit patterns so it exercises every data line in both directions. It also does address-line walking, where it writes a unique value to each address and checks that writing address A never corrupts address B. That catches wiring and controller faults a naive pattern test sails right past.

Modern testers add row hammer stress too. That hammers adjacent memory rows fast enough to flip bits in the row between them, which is a real hardware weakness in dense DRAM, not a theoretical one. When someone says a "pass" completed, that is what got certified: one full sweep of these algorithms across the mapped memory. One sweep. Marginal cells fail intermittently, so a single sweep is closer to a coin flip than a clean bill of health.

Why in-OS testing gives you false confidence

Because the operating system is standing between the tester and the actual chips. When a program allocates memory under Linux or Windows, it gets virtual addresses. The kernel decides which physical pages those map to, and it keeps large regions for itself that no userspace tester can ever touch.

So an in-OS tool tests whatever physical pages the kernel happened to hand it. The bad cell might sit in a page the kernel reserved for its own slab caches, DMA buffers, or the page cache. Your tester never sees it, reports clean, and you ship the box.

There is a nastier twist on ECC systems. ECC memory silently corrects single-bit errors through a background scrub, so a marginal cell that flips one bit gets fixed before any tester reads it. The error is real and getting worse, but the OS-level tool sees corrected data and calls it healthy.

Bare-metal MemTest86 reads the ECC error counters directly, which is exactly the visibility an in-OS process cannot get. If you want the OS itself to surface those counters, you need the right kernel config options enabled first, and even then the reporting lags the hardware. This is why I do not trust in-OS results for a real fault hunt.

How many passes does it take to trust a clean result?

Run at least four full passes, and run them overnight if the machine matters. A single pass that comes back clean is the single most common reason people wrongly clear their RAM and go hunting the wrong component.

Here is what happens with a marginal cell. It fails only at a specific temperature, or only after the sticks have been powered long enough to drift, or only when one exact bit pattern hits it. Pass one runs cold and clean. Pass three, forty minutes in with the DIMMs hot, throws the first error. If you stopped at one pass you would have called it good and blamed the CPU.

More passes buy you two things: thermal soak and pattern coverage. The RAM heats up as the test runs, and heat is when weak cells give up. Longer runtime also means more chances for an intermittent fault to line up with the pattern that triggers it. If you have a real reason to suspect the memory, an eight-hour run is not paranoia. It is the difference between a reproducible answer and another wasted evening.

Reading the error output to find the failing DIMM

"RAM is bad" is useless. You need to know which stick to pull, and MemTest86 gives you that if you read the failing address, not just the error count.

The tester prints the physical address where the compare failed. Every motherboard maps physical address ranges to specific slots, so a failing address belongs to exactly one DIMM. Newer MemTest86 builds do part of this for you and print the DIMM slot in the error table. When it does, trust it and pull that stick.

When it only gives you a raw address, do this:

  1. Note the lowest failing address, because that is the cleanest to map.
  2. Pull up your board's memory map. On UEFI systems the RAM controller reports slot-to-address ranges, and MemTest86's own DIMM report shows which slots cover which ranges.
  3. Match the failing address into the range that names a slot, for example DIMM_A2.
  4. Confirm by swapping. Move the suspect stick to a slot you know is good and re-run. If the error follows the stick, the stick is bad. If it stays with the slot, your problem is the board or the CPU's memory controller.

That last swap is the step people skip, and it is the one that tells you whether you are buying memory or an entire motherboard.

What different error patterns tell you about the failure

The bit pattern of the error points straight at the failure mode, so read it before you order parts.

Error patternLikely causeWhat to do
Single-bit error, same addressMarginal DRAM cell or loose timingRetest hot; try relaxing timings or bumping voltage slightly
Multi-bit error on one data lineFaulty data line or solder jointReplace the DIMM; the trace or chip is bad
Address error (wrong location touched)Address line or memory controller faultSuspect the board or CPU, not just the stick
Errors only above a heat thresholdThermal-marginal cellImprove airflow, then decide if it needs replacing

A single flipped bit that always lands at the same address is usually one weak cell or timing that is a hair too tight. A multi-bit error clustered on the same data bit across many addresses points at one physical data line, which means the stick is done. Address errors are the scary ones, because they mean a write went to the wrong place. That is rarely a single cell and usually the controller or wiring, which is why address errors so often precede a kernel panic that looks random.

If you are chasing panics that smell like memory but you are not sure, my tested method for diagnosing a kernel panic walks the rest of the trail from the panic message back to the cause.

When an in-OS tester is actually good enough

For a smoke test, not a diagnosis. There are a few honest cases where booting external media is not worth it.

  • A quick sanity check on a production Windows box you cannot reboot to bare metal right now.
  • A post-upgrade confidence check after you swapped or reseated sticks, just to catch a stick that is dead rather than marginal.
  • An automated check in a CI pipeline, where you want a cheap signal that a builder node has not developed obvious hardware rot.

In all three you are looking for gross failure. Subtle marginal cells stay out of reach. HCI Memtest is decent here because it runs several independent instances at once to grab as much userspace memory as the OS will give it, which raises your odds of hitting a bad page under real allocation pressure. Windows Memory Diagnostic is fine for the reboot-and-check-once case, but its default extended run is a single pass and regularly misses cells that four passes of MemTest86 catch.

Use these to say "this stick is clearly dead." Never use them to say "this memory is good." They cannot see kernel memory or DMA regions, and that is exactly where the sneaky faults hide.

How do you stress memory that passes memtest but still crashes?

Attack the conditions memtest does not create: sustained thermal load, cache traffic, and timing at the edge. A stick can pass a clean pattern test and still fail when the CPU is hammering the memory controller under a real workload.

Start with the profile. If you enabled XMP on Intel or EXPO on AMD, that is your board running the RAM faster than its guaranteed baseline. It is an overclock, and overclocks fail. Boot to the stock JEDEC profile and see if the crashes stop. If they do, the sticks are fine and the profile was too aggressive for your controller or your cooling.

Next, stress the paths standalone testers ignore. On Linux, run stress-ng --vm 4 --timeout 30m with --vm-bytes sized to claim most of your free RAM. It pounds allocation and cache coherency in a way a linear memtest never does. On multi-socket boxes it also exercises NUMA cross-node access, which is a common source of "passes memtest, panics under load." When that panic lands inside a driver, my guide to debugging a kernel module picks up the trail. Prime95's blend mode does the same job on Windows and heats the whole platform hard.

Then margin the voltage. Nudge DRAM voltage up a small notch within spec and retest; a marginal cell often stabilizes with a hair more voltage, which tells you it was borderline all along. If the fault only shows up hot, your problem may be airflow, not silicon. Add a fan on the DIMMs and rerun the same stress before you spend money.

Which memtester to reach for

Match the tool to the job instead of running whatever boots first.

  • MemTest86 – your default for any real diagnosis. UEFI-native, tests outside the OS, and its error output maps to physical slots. Grab whatever the PassMark page lists as current in the 11.x line rather than a stale ISO, and read the official MemTest86 documentation for the boot media steps.
  • Memtest86+ – the open-source fork of the original code. Reach for it on legacy BIOS machines, or when you want auditable source instead of a proprietary binary. The Memtest86+ project publishes the code and builds.
  • HCI Memtest – in-OS, runs many instances to cover userspace memory under real pressure. Good for reproducing intermittent errors, blind to kernel and DMA memory.
  • Windows Memory Diagnostic – built in, fine for a one-off sanity check you cannot reboot for. Its single default pass is the ceiling of what it proves.
  • stress-ng – not a memtester, but the right complement on Linux for cache, coherency, and NUMA faults that memtest cannot trigger. My go-to when a panic smells like memory but MemTest86 came back clean.
  • Karhu RAM Test – the most thorough Windows-native option, coverage close to MemTest86, but paid. Exhaust the free bare-metal tools before you buy it.

The short decision: real fault, boot MemTest86 and run it four passes plus. Quick reassurance, an in-OS tool is fine. Passes but still crashes, stop testing patterns and start stressing heat, timing, and voltage.

FAQ

Can a CPU or motherboard fault look like bad RAM in memtest?
Yes, and this trips people constantly. If the errors follow the slot instead of the stick when you swap DIMMs around, the memory controller lives on the CPU (or the traces on the board) and that is your real suspect. Address-type errors especially point away from the stick and toward the controller.

Does ECC memory make memtest unnecessary?
No. ECC corrects and reports errors, but a stick throwing constant single-bit corrections is degrading and will eventually produce an uncorrectable multi-bit fault that panics the box. Run MemTest86 so you can read the ECC counters directly and catch the trend before it becomes an outage.

How long does a full MemTest86 run take?
It depends entirely on capacity, speed, and how many passes you set. A single pass on a large-memory server can run hours, so plan on leaving four or more passes overnight. Do not babysit it and do not stop it early because the first pass looked clean.

Is a bootable USB stick or a bootable CD better for running memtest?
Use a USB stick with a UEFI-capable build. Optical media is slow, most boards no longer have a drive, and modern MemTest86 wants a UEFI environment to enumerate memory correctly. Write the image to USB, disable Secure Boot if it blocks the loader, and boot straight to it.

Why did my RAM pass memtest but crash only during gaming or compiling?
Because that workload creates heat and memory-controller pressure a linear pattern test never reaches. Nine times out of ten it is an XMP or EXPO profile pushing the controller past what it can hold under load. Drop to stock timings, retest with stress-ng or Prime95, and the fault usually shows itself.

Related on this blog