libmemtester-rs
This project is a Rust library for testing memory. It is a Rust version of memtester.
The goal of this crate is to provide a cross-platform memory tester (it has been tested on Linux and Windows) that can be used in other projects.
It works by allocating a large chunk of memory and then writing a pattern to it. It then reads the memory and checks that the pattern is correct. It does this for a number of different patterns. If the memory is faulty, it will detect it and return a hashmap of the faulty addresses and the number of times they were faulty.
To prevent the operating system from swapping out the memory and moving pages, this crate locks the memory (using mlock
syscall on Linux and VirtualLock
on Windows).
In order to do this, the crate needs to be run as root.
⌨ Usage
use MemoryTests;
You can see an example of this crate being used in memtester-rs.
📃 License
This project is licensed under the GPLv3 licence - see the LICENSE file for details