A simple memory testing utility
at main 43 lines 1.3 kB view raw view rendered
1# memtest 2 3This is a simple utility which allocates as much megabytes of RAM as requested, pausing 0 or more seconds during allocation. It was designed to verify the progression of memory allocation on Linux environments under cgroups constraints for memory usage. 4 5## Building 6 7The following dependencies are required to build the software: gcc, automake, and [valgrind](http://valgrind.org/) for the small test suite. 8 9- `make all` to build, test, and prepare the program for release. 10- `make test` to build and test the program. 11- `make memtest` to just build the program. 12- `make clean` to clean the entire workspace. 13 14## Using 15 16The program accepts two arguments: 17 18- -m: memory size in MB, required. 19- -s: number of seconds to wait between allocations, optional. 20 21### Sample run 22 23```ShellSession 24./memtest -m 12 25Memory allocation test up to 12 MB, sleeping 0 seconds between allocations 26Total allocation 0 MB...success! 27Total allocation 1 MB...success! 28Total allocation 2 MB...success! 29Total allocation 3 MB...success! 30Total allocation 4 MB...success! 31Total allocation 5 MB...success! 32Total allocation 6 MB...success! 33Total allocation 7 MB...success! 34Total allocation 8 MB...success! 35Total allocation 9 MB...success! 36Total allocation 10 MB...success! 37Total allocation 11 MB...success! 38Successfully allocated 12 MB 39``` 40 41## License 42 43MIT License