When working with custom ARM boards, thorough memory testing becomes crucial - especially for non-ECC RAM where error detection isn't built-in. Unlike x86 systems, ARM architectures present unique challenges for memory benchmarking.
For immediate testing without rebooting, these Linux-native tools work well on ARM:
# Stream Benchmark (measures memory bandwidth)
wget https://www.cs.virginia.edu/stream/FTP/Code/stream.c
gcc -O3 -fopenmp -DSTREAM_ARRAY_SIZE=10000000 -DNTIMES=20 stream.c -o stream
./stream
For comprehensive memory integrity checks:
- stressapptest:
git clone https://github.com/stressapptest/stressapptest.git cd stressapptest ./configure make ./src/stressapptest -s 3600 -M 256 -m 8 -W
- memtester (user-space alternative to MemTest86):
apt install memtester memtester 256M 5
Combine memory benchmarks with thermal monitoring:
# Simple monitoring script
while true; do
cat /sys/devices/platform/****/temp1_input >> memtest_temp.log
sleep 5
done
When existing tools don't meet requirements, consider writing targeted tests:
// Sample memory pattern test in C
#define SIZE (1024*1024*256) // 256MB
void *mem = malloc(SIZE);
memset(mem, 0xAA, SIZE);
for(unsigned i=0; i<SIZE; i++) {
if(((char*)mem)[i] != 0xAA) {
printf("Memory error at %u\n",i);
}
}
The StressLinux distribution provides a comprehensive suite but requires system reboot. For production testing, it's worth the interruption:
dd if=stresslinux.iso of=/dev/sdX bs=4M
sync
When testing non-ECC memory on custom ARM boards, you need a multi-layered approach combining performance benchmarks with integrity checks. Here's what I've found most effective:
STREAM Benchmark remains the gold standard for memory bandwidth testing. To compile for ARM:
wget http://www.cs.virginia.edu/stream/FTP/Code/stream.c
gcc -O3 -fopenmp -DSTREAM_ARRAY_SIZE=10000000 -DNTIMES=20 stream.c -o stream
./stream
For more comprehensive testing, consider lmbench which provides memory latency measurements:
git clone https://github.com/intel/lmbench
cd lmbench
make results
make see
While standard tools like memtest86+ don't support ARM, alternatives exist:
- Memtester (works in userspace):
sudo apt install memtester
memtester 100M 5
stress-ng --vm 4 --vm-bytes 1G --vm-method xor --verify
For real-time monitoring during tests, create a monitoring script like:
#!/bin/bash
while true; do
temp=$(cat /sys/devices/platform/.../temp1_input)
echo "$(date) - Temperature: $((temp/1000))°C" >> memtest.log
sleep 5
done
For non-ECC memory, focus on:
- Extended duration tests (48+ hours)
- Pattern tests (walking 1/0, checkerboard)
- Concurrent load testing (memory + CPU)
Example combined test using stress-ng:
stress-ng --vm 2 --vm-bytes 75% --vm-method inc-nybble \
--cpu 4 --io 2 --timeout 24h --metrics-brief
For intensive testing, specialized distros like StressLinux provide pre-configured tools. To create a custom test environment:
debootstrap --arch=arm64 bullseye ./arm-rootfs
chroot ./arm-rootfs
apt install stress-ng lmbench memtester sysstat