A userspace memory tester for Linux, written in Rust.
Named after ferrite core memory — the dominant RAM technology of the 1960s and 70s, where tiny iron rings were magnetized to store individual bits. Testing RAM with iron.
Allocates a region of physical RAM, locks it against swapping via mlock, then runs a suite of test patterns to detect stuck bits, address line faults, coupling errors, and other common failure modes. Designed to run while the OS is live — not a replacement for memtest86+, but a fast sanity check you can run without a reboot.
- Solid Bits — fills with all-ones then all-zeros
- Walking Ones / Walking Zeros — walks a single set/cleared bit across each 64-bit word
- Checkerboard — alternating
0x55...55/0xAA...AApatterns - Stuck Address — writes each word's index, verifies the address mapping is intact
All writes use non-temporal stores (AVX-512 when available) and all reads/writes use volatile operations to prevent the compiler from optimizing away memory accesses.
# Test 64M of RAM (default)
ferrite
# Test a specific amount
ferrite --size 4G
# Run 3 passes over the allocation
ferrite --passes 3
# Run only specific tests
ferrite --test solid-bits --test checkerboard
# NDJSON event stream to stdout
ferrite --json
# NDJSON to a file, human output to stdout
ferrite --json results.ndjsonLarge allocations require sufficient RLIMIT_MEMLOCK — either run as root, raise the limit with ulimit -l unlimited, or grant CAP_IPC_LOCK to the binary.
memtester works. ferrite aims to be:
- More informative — reports which bits flipped, at what offset, in what pattern
- Parallel — uses all available cores via Rayon for write and verify phases
- Scriptable — NDJSON output mode for machine consumption
- Faster — AVX-512 non-temporal stores where available, avoiding cache pollution
- Physical address resolution — resolves virtual-to-physical mappings via
/proc/self/pagemapwith batch pread, including kpageflags support - ECC monitoring — reads EDAC sysfs counters before/after test runs, reports correctable/uncorrectable error deltas
- DIMM identification — parses SMBIOS Type 17 entries and merges with EDAC topology to identify failing modules
- Error analysis — classifies bit-flip errors as stuck-bit or coupling faults
- Page mapping stability — verifies physical page mappings haven't migrated between test passes
- NUMA-aware allocation and per-node testing
Userspace testing cannot reach 100% of RAM — the kernel, running processes, and ferrite itself occupy memory that can't be touched. For comprehensive coverage, use memtest86+.
cargo build --releaseRequires Rust 1.89+ (2024 edition).