Linux: How do I find out causes for memory faults?

by on April 20, 2006 · 7 comments· LAST UPDATED December 11, 2006

in , ,

Memory faults can occur due to various causes.

You can use memtester command which stress test to find memory subsystem faults. memtester command is an effective userspace tester for stress-testing the memory subsystem. It is very effective at finding intermittent and non-deterministic faults under Linux.

You can run memtester as follows:

memtester MEMORY ITERATIONS

Where,
=> MEMORY: The amount of memory to allocate and test, in megabytes
=> ITERATIONS: Number of loops to iterate through. Default is infinite

memtester's exit code is 0 when everything works properly. Otherwise, it is the logical OR of the following values:

  • x01: Error allocating or locking memory, or invocation error
  • x02: Error during stuck address test
  • x04: Error during one of the other tests

Example
$ memtest 5 1Output:

memtester version 4.0.5 (32-bit)
Copyright (C) 2005 Charles Cazabon.
Licensed under the GNU General Public License version 2 (only).
pagesize is 4096
pagesizemask is 0xfffff000
want 5MB (5242880 bytes)
got  5MB (5242880 bytes), trying mlock ...locked.
Loop 1/1:
Stuck Address       : ok
Random Value        : ok
Compare XOR         : ok
Compare SUB         : ok
Compare MUL         : ok
Compare DIV         : ok
Compare OR          : ok
Compare AND         : ok
Sequential Increment: ok
Solid Bits          : ok
Block Sequential    : ok
Checkerboard        : ok
Bit Spread          : ok
Bit Flip            : ok
Walking Ones        : ok
Walking Zeroes      : ok
Done.

Display memtester's exit code with following command (it is 0 when everything works properly):
$ echo $?
Output:

0
TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 7 comments… read them below or add one }

1 Jon Nguyen March 23, 2009 at 4:55 am

What is difference of memtester and memtest86 in term of testing memory module?

Thanks,
jon

Reply

2 salseeg November 1, 2009 at 1:54 pm

memtest86 is memory testing OS , it loads as separate one, using bootloader.
memtester is ser space ie you do not need to reboot your PC to test memeory, but it cannot test all your memory, since some part used by your OS

Reply

3 Unihost Brasil - Webhosting November 16, 2010 at 9:36 am

Here’s the link to download the MEMTEST utility from the official developer site:

http://pyropus.ca/software/memtester/

Alex M. – Tech Support – Unihost Brasil

Reply

4 Radek February 2, 2011 at 8:04 pm

The command should read:

memtester 5 1

Reply

5 Brian Lockwood April 12, 2011 at 3:14 pm

Is memtester a distructive test routine? Meaning all contents in that memory space will be lost once memteser is run.

Thanks

Brian

Reply

6 Peter November 21, 2011 at 10:44 pm

Thank you very much for those commands. I’ve been looking at Memtester for a little while trying to figure out how to use it. The manual is always a little intimidating for novices; and your commands ran perfectly.

I’m now testing a gig on an 8 gig system with 5 passes using:

memtester 1000 5

It looks like it is going to take a while but I’d much rather test in user space than have to boot into an iso and sit it out.

Thanks again.
Peter

Reply

7 Ted February 12, 2013 at 7:23 pm

Say my system has 8G — two 4G modules — and say there’s a physical defect in one byte of one of those modules. What’s the chance memtester will detect that defect if I run it as “memtester 1000 5″? As “memtester 2000 5″? Etc…

Reply

Leave a Comment

Tagged as:

Previous Faq:

Next Faq: