| 1 |
.TH membench 1 "February 9 2026" |
| 2 |
.SH NAME |
| 3 |
membench \- modern memory bandwidth and latency benchmarks |
| 4 |
.SH SYNOPSIS |
| 5 |
.B membench |
| 6 |
.RI [ options ] |
| 7 |
.br |
| 8 |
.SH DESCRIPTION |
| 9 |
This manual page documents briefly the |
| 10 |
.B membench |
| 11 |
command. |
| 12 |
.PP |
| 13 |
\fBmembench\fP is a portable, multi-platform memory bandwidth benchmark designed for |
| 14 |
comprehensive system analysis. |
| 15 |
.br |
| 16 |
Latency measurement uses linked list traversal with random node order |
| 17 |
to defeat prefetchers. Statistical validity ensured via multiple samples |
| 18 |
until coefficient of variation < 5% or max samples reached. |
| 19 |
.TP |
| 20 |
Memory model: each thread gets its own buffer. |
| 21 |
.TP |
| 22 |
Total memory = size_kb × threads (×2 for copy: src + dst). |
| 23 |
.SH OPTIONS |
| 24 |
.TP |
| 25 |
.B \-h |
| 26 |
Show this help |
| 27 |
.TP |
| 28 |
.B \-V |
| 29 |
Print version and exit |
| 30 |
.TP |
| 31 |
.B \-v |
| 32 |
Verbose output (use -vv for more detail) |
| 33 |
.TP |
| 34 |
.B \-s SIZE_KB |
| 35 |
Test only this buffer size (in KB), e.g. -s 1024 for 1MB |
| 36 |
.TP |
| 37 |
.B \-f |
| 38 |
Full sweep (test all sizes up to memory limit) |
| 39 |
.br |
| 40 |
Default: test up to 512 MB per thread |
| 41 |
.TP |
| 42 |
.B \-p THREADS |
| 43 |
Use exactly this many threads (default: num_cpus) |
| 44 |
.TP |
| 45 |
.B \-a |
| 46 |
Auto-scaling: try different thread counts to find best |
| 47 |
.br |
| 48 |
(slower but finds optimal thread count per buffer size) |
| 49 |
.TP |
| 50 |
.B \-t SECONDS |
| 51 |
Maximum runtime, 0 = unlimited (default: unlimited) |
| 52 |
.TP |
| 53 |
.B \-r TRIES |
| 54 |
Repeat each test N times, report best (default: 3) |
| 55 |
.TP |
| 56 |
.B \-o OP |
| 57 |
Run only this operation: read, write, copy, or latency |
| 58 |
.br |
| 59 |
Can be specified multiple times (default: all) |
| 60 |
.TP |
| 61 |
.B \-H |
| 62 |
Enable huge pages for large buffers (>= 4MB) |
| 63 |
.br |
| 64 |
Uses THP (no setup needed) or explicit 2MB pages |
| 65 |
.br |
| 66 |
Automatically skipped for small buffers |
| 67 |
.TP |
| 68 |
.B \-R |
| 69 |
Human-readable output with summary (default: CSV) |
| 70 |
|
| 71 |
.SH ENVIRONMENT VARIABLES |
| 72 |
OpenMP Thread Affinity (environment variables): |
| 73 |
OMP_PROC_BIND=spread Spread threads across NUMA nodes (default) |
| 74 |
OMP_PLACES=cores One thread per physical core |
| 75 |
OMP_NUM_THREADS=N Override thread count |
| 76 |
.SH CSV OUTPUT |
| 77 |
Output: CSV to stdout with columns: |
| 78 |
size_kb - Per-thread buffer size (KB) |
| 79 |
operation - read, write, copy, or latency |
| 80 |
bandwidth_mb_s - Aggregate bandwidth in MB/s (0 for latency) |
| 81 |
latency_ns - Median memory latency in ns (0 for bandwidth) |
| 82 |
latency_stddev_ns - Latency standard deviation in ns (0 for bandwidth) |
| 83 |
latency_samples - Number of samples for latency measurement |
| 84 |
threads - Thread count used |
| 85 |
iterations - Iterations performed |
| 86 |
elapsed_s - Elapsed time in seconds |
| 87 |
|
| 88 |
.SH SEE ALSO |
| 89 |
.BR tinymembench (1), |
| 90 |
.BR memtester (8). |
| 91 |
.br |
| 92 |
|