Servers

Linux memory test to find hardware issues

Hardware issues is a pain in the ass

Memory faults can occur due hardware causes. And here is an example to find errors and avoid server crashes.

There are a command memtest which stress test the memory in order to find faults. It is a effective at finding intermittent and non-deteministic faults under Linux.

If you are using debian you can easily get it by typing

Example:

# apt-get install memtester

It is then possible to choose how the test should be performed here is an example that running memtest with 10MiB memory to use and run it 1 iteration.
# memtest 10M 1

memtest v. 2.93.1
(C) 2000 Charles Cazabon
Original v.1 (C) 1999 Simon Kirby

Current limits:
RLIMIT_RSS 0xffffffff
RLIMIT_VMEM 0xffffffff
Raising limits...
Allocated 10485760 bytes...trying mlock...success. Starting tests...

Testing 10481664 bytes at 0xb744c000 (4088 bytes lost to page alignment).

Run 1:
Test 1: Stuck Address: Testing...Passed.
Test 2: Random value: Setting...Testing...Passed.
Test 3: XOR comparison: Setting...Testing...Passed.
Test 4: SUB comparison: Setting...Testing...Passed.
Test 5: MUL comparison: Setting...Testing...Passed.
Test 6: DIV comparison: Setting...Testing...Passed.
Test 7: OR comparison: Setting...Testing...Passed.
Test 8: AND comparison: Setting...Testing...Passed.
Test 9: Sequential Increment: Setting...Testing...Passed.
Test 10: Solid Bits: Testing...Passed.
Test 11: Block Sequential: Testing...Passed.
Test 12: Checkerboard: Testing...Passed.
Test 13: Bit Spread: Testing...Passed.
Test 14: Bit Flip: Testing...Passed.
Test 15: Walking Ones: Testing...Passed.
Test 16: Walking Zeroes: Testing...Passed.
Run 1 completed in 32 seconds (0 tests showed errors).
munlock'ed memory.
1 runs completed. 0 errors detected. Total runtime: 32 seconds.

One thought on “Linux memory test to find hardware issues

Leave a Reply

Your email address will not be published. Required fields are marked *