Unofficial

MemHound: a RAM test for a running NAS

One static program tests the free memory of a QNAP NAS over SSH. The LiveCD tests nearly all of the memory of a PC or an x86 NAS.

MemHound takes the free memory in blocks of 128 MB. It locks each block in RAM, writes test patterns into it and reads them back. For each faulty word it shows the physical address.

The NAS keeps serving files during the test. MemHound keeps 256 MB of memory free and runs at the lowest priority. If the memory runs out, the system stops MemHound before any other program.

Version 0.6.10 · x86_64, aarch64 and armhf · QTS and QuTS hero · freeware

  • 128MB in each block that MemHound locks and tests
  • 256MB of memory that always stay free for the NAS
  • 21tests on each block in an Extended pass

How a test runs

Without options, MemHound runs the whole RAM test in four steps. Step 3 repeats until you press q.

  1. Free the memory

    MemHound writes the cache to disk and drops it. On QuTS hero it also empties the ZFS ARC. The test can then use more memory.

    sync, drop_caches, zinject -a
  2. Quick pass

    Three tests on each block: the address test, a checkerboard and moving inversions with random values.

    86 ms for each block of 128 MB
  3. Extended passes

    21 tests on each block. Before each pass MemHound frees the memory again. The passes repeat until you press q or MemHound finds a fault.

    5.3 s for each block of 128 MB
  4. The result

    A large word shows the result. Under it are two lines: what MemHound found and what to do next. Then comes the full summary.

    Tested X MB of Y MB (Z%)

Inside a pass: one block at a time

A pass tests one block at a time and releases it before it takes the next one:

  1. MemHound takes 128 MB of free memory and locks it with mlock. The system cannot then move it to swap.
  2. It runs the address test first. If this test fails, MemHound marks all other results as uncertain.
  3. It runs the pattern tests. Each test writes the whole block, pushes it out of the CPU cache and then reads it back.
  4. It releases the block and takes the next one. Before each block it checks that 256 MB stay free.

If a word reads back wrong, MemHound reads it again up to 8 times and keeps its physical address. A fault that repeats at the same address is a hard fault. A fault that does not repeat is a transient fault.

The 21 tests of an Extended pass

The time of each test on one block of 128 MB. We measured it with MemHound 0.6.10 on a QNAP NAS with an Intel Core i5-1235U and 16 GB of RAM. Point at a bar to see what the test writes.

One block of 128 MB, all tests

  • Quick pass86 ms
  • Extended pass5 337 ms
  • Address test, first in every pass
  • Also in the Quick pass
  • Standard tests
  • Compare tests
  • stuck-addr14 msWrites the address of each word into the word, then reads every word back.
  • solid013 msWrites all bits 0, then reads them back.
  • solid114 msWrites all bits 1, then reads them back.
  • checker24 msWrites alternating 0 and 1 bits, then the inverse pattern.
  • movinv028 msMoving inversions: fills with 0, then reads and inverts each word, first upward, then downward.
  • movinv126 msThe same moving inversions, starting from all bits 1.
  • movinv-rand31 msMoving inversions with random values that a seed can repeat.
  • modulo20250 msWrites a value into every 20th word and its inverse into all other words, 20 times.
  • walk1 590 msMoves a single 1 bit through each position of the word, then a single 0 bit.
  • movinv8206 msMoving inversions with 8 byte patterns, one set bit in each.
  • blockseq209 msFills the block with 16 byte values (00, 55, AA, FF and others) and reads each back.
  • bitflip1 626 msAlternates a word with one bit set and a word with only that bit clear, for each of the 64 bits.
  • bitspread805 msThe same with two adjacent bits, for each adjacent pair of the 64 bits.
  • rand-dual71 msWrites the same random values into both halves of the block and compares the halves.
  • cmp-xor58 msBoth halves get random values combined with one number by XOR, then MemHound compares them.
  • cmp-sub58 msThe same compare, with subtraction.
  • cmp-mul58 msThe same compare, with multiplication.
  • cmp-div66 msThe same compare, with division.
  • cmp-or58 msThe same compare, with OR.
  • cmp-and57 msThe same compare, with AND.
  • seqinc75 msThe same compare, with values that increase from word to word.
Most tests take under 0.1 s. walk and bitflip take 1.6 s each because they move one bit through every position of a 64-bit word.
Show the numbers as a table
TestGroupmsWhat it does
stuck-addrAddress test, first in every pass14Writes the address of each word into the word, then reads every word back.
solid0Standard tests13Writes all bits 0, then reads them back.
solid1Standard tests14Writes all bits 1, then reads them back.
checkerAlso in the Quick pass24Writes alternating 0 and 1 bits, then the inverse pattern.
movinv0Standard tests28Moving inversions: fills with 0, then reads and inverts each word, first upward, then downward.
movinv1Standard tests26The same moving inversions, starting from all bits 1.
movinv-randAlso in the Quick pass31Moving inversions with random values that a seed can repeat.
modulo20Standard tests250Writes a value into every 20th word and its inverse into all other words, 20 times.
walkStandard tests1 590Moves a single 1 bit through each position of the word, then a single 0 bit.
movinv8Standard tests206Moving inversions with 8 byte patterns, one set bit in each.
blockseqStandard tests209Fills the block with 16 byte values (00, 55, AA, FF and others) and reads each back.
bitflipStandard tests1 626Alternates a word with one bit set and a word with only that bit clear, for each of the 64 bits.
bitspreadStandard tests805The same with two adjacent bits, for each adjacent pair of the 64 bits.
rand-dualStandard tests71Writes the same random values into both halves of the block and compares the halves.
cmp-xorCompare tests58Both halves get random values combined with one number by XOR, then MemHound compares them.
cmp-subCompare tests58The same compare, with subtraction.
cmp-mulCompare tests58The same compare, with multiplication.
cmp-divCompare tests66The same compare, with division.
cmp-orCompare tests58The same compare, with OR.
cmp-andCompare tests57The same compare, with AND.
seqincCompare tests75The same compare, with values that increase from word to word.

The address test

A memory module finds a word by its address. If an address line is broken, two addresses lead to the same cell. Then a pattern test can write and read the same wrong cell and see no fault.

So the address test runs first, on each block. It writes the address of each word into the word. Then it reads every word back. A word that holds the address of another word shows a broken address line.

If the address test fails, the result is CRITICAL: the other tests of that run cannot prove anything.

A good module

AddressWrittenRead back
100010001000
100810081008
101010101010
101810181018
102010201020
102810281028
103010301030
103810381038

Address line 5 stuck at 0

AddressWrittenRead back
100010001020
100810081028
101010101030
101810181038
102010201020
102810281028
103010301030
103810381038
With line 5 stuck, the writes to 1020 to 1038 land in the cells of 1000 to 1018. The first four words then read back the wrong addresses.

What each result means

At the end of a test that you started yourself, MemHound shows one of six words in large letters. A test from the StorageDiag app, the USB image or the LiveCD countdown does not show this screen.

  • PASSED

    No faults. In the whole test, MemHound also reached at least 80% of the RAM.

    The memory is good.

  • BAD RAM

    Hard faults: a fault repeats at the same address.

    Suspect the memory module. The summary lists the addresses.

  • CRITICAL

    The address test failed: some addresses lose their data.

    Suspect the memory module or the memory controller.

  • FAILED

    Transient faults only: they did not repeat at the same address.

    Power, heat or memory timing can cause them. Run the test again.

  • PARTIAL

    No faults, but MemHound tested less than 80% of the RAM, or the test ended early.

    Stop services and run the test again, or use the LiveCD.

  • STOPPED

    You stopped a test with a chosen profile before its end.

    Run the test to its end to get a result.

Exit codes of the whole test, for scripts: 0 PASSED, 1 hard faults, 2 transient faults only, 3 CRITICAL or PARTIAL.

Two test runs, recorded

Two runs of MemHound 0.6.10 on a QNAP NAS, in a terminal of 80 by 25 characters. The first run ends with PASSED. In the second run, --demo fault flips one bit on purpose, and the run ends with BAD RAM.

./memhound --demo pass --ui280×25
                                                                                                                                                                                                                                                                                                                                                                                                                   ╔═════════════════════ MemHound 0.6.10: the result ══════════════════════╗      ║                                                                        ║      ║            ▄▄▄▄▄▄  ▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄              ║      ║            ███ ███ ███ ███ ███▄▄▄▄ ███▄▄▄▄ ███ ███ ███ ███             ║      ║            ▓▓▓ █▓█ ▓▓▓▀▓▓▓ ▀▀▀▀▓▓▓ ▀▀▀▀▓▓▓ ▓▓▓▄▀▀▀ ▓▓▓ ▓▓▓             ║      ║            ▒▒▒▀▀▀  ▒▒▒ ▒▒▒ ▒▒▒ ▒▒▒ ▒▒▒ ▒▒▒ ▒▒▒ ▄▄▄ ▒▒▒ ▒▒▒             ║      ║            ░░░     ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░             ║      ║            ▀▀▀     ▀▀▀ ▀▀▀ ▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀ ▀▀▀▀▀▀              ║      ║                                                                        ║      ║                   No faults found. Tested 12.75GiB.                    ║      ║         Demo run (--demo pass): 10 seconds of the Quick test.          ║      ║                                                                        ║      ║         Press Enter, Space, Esc or Q to see the full summary.          ║      ╚════════════════════════════════════════════════════════════════════════╝                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
Recorded on 2026-11-16 from the real program. The demo tests 256 MB for 10 seconds. A real test runs longer. Font: IBM VGA 8x16 from The Ultimate Oldschool PC Font Pack by VileR, CC BY-SA 4.0. int10h.org · LICENSE-oldschool-pc-fonts.txt

Run it over SSH

Sign in to the NAS over SSH as an administrator and run these commands. The archive contains the program for three processor types. The commands select the one for your NAS.

# on the NAS, over SSH
arch=$(uname -m)
# uname says armv7l; the program is named armhf
[ "$arch" = armv7l ] && arch=armhf
wget https://qnaputilities.com/pub/memhound/bin/memhound.tar.gz
tar zxvf memhound.tar.gz
chmod +x memhound*
./memhound-$arch

MemHound installs nothing. To remove it, delete the files.

Common commands

./memhound-$arch
The whole test: Quick, then Extended passes until you press q.
./memhound-$arch --passes 2
The same, and the test stops by itself after 2 Extended passes.
./memhound-$arch --quick
One Quick pass.
./memhound-$arch --full
Tests nearly all free memory in one run. Use it when the NAS is idle.
./memhound-$arch --report /tmp/memhound.txt
Also writes the summary to a text file.
./memhound-$arch --bench --ui2
Measures memory speed and latency, without a fault test.
./memhound-$arch --demo pass --ui2
A demo run of 10 seconds that ends with PASSED. --demo fault ends with BAD RAM.
./memhound-$arch --help
Shows all options.

Download

The program for x86_64, aarch64 and armhf, and the LiveCD for PCs and x86 NAS models.

Test nearly all of the memory: the LiveCD

On a running NAS, QTS and its apps use part of the memory, and MemHound cannot test that part. The LiveCD starts a small Linux system with only MemHound in it, so the test reaches nearly all of the RAM.

It starts PCs and x86 NAS models with an HDMI port. An ARM NAS cannot start it. If Secure Boot is on, switch it off first.

  1. Write the ISO image to a USB stick with balenaEtcher, Rufus or dd, or burn it to a CD.
  2. Connect a monitor and a USB keyboard, then start the computer from the stick.
  3. Press 1 to start the test. If you press no key, the test starts by itself after 15 seconds, and a clean result restarts the computer 60 seconds later.
  4. Read the report in the folder memhound on the stick. On a stick written whole, it is on the partition MHDATA. If the memory is bad, the result stays on the screen and the computer stops.

Limits

  • On a running NAS, MemHound tests only the free memory. If it reaches less than 80% of the RAM, the result is PARTIAL. The LiveCD reaches nearly all of it.
  • MemHound runs as a normal program, so the test also uses the processor, its cache and the memory controller. A fault shows that this chain failed. Hard faults at fixed physical addresses point to a memory module.
  • Physical addresses need the root account. Without it, MemHound shows a logical map.
  • MemHound names the slot of a fault only if the system has EDAC labels for its modules.
  • --demo fault flips a bit on purpose. Its BAD RAM is not a test result.

Related pages

This page as Markdown: memhound.md.