Very simple memory tester - the tiny sibling of memtester.
What it does:
- Allocate
SIZE_MIB
megabytes of RAM andmlockall()
it - Fill it with pseudorandom data from
rand()
- Verify the contents
./umemtester SIZE_MIB
$ ./umemtester 1000
testing 1000 MiB
warning: could not lock memory: Cannot allocate memory
filling
verifying
ok
- 0 = ok
- 1 = usage error
- 2 = memory corruption