membench(1)

NAME
membench - modern memory bandwidth and latency benchmarks

SYNOPSIS
membench [options]

DESCRIPTION
This manual page documents briefly the membench command.

membench is a portable, multi-platform memory bandwidth benchmark designed for comprehensive system analysis.
Latency measurement uses linked list traversal with random node order to defeat prefetchers. Statistical validity ensured via multiple samples until coefficient of variation < 5% or max samples reached.

Memory model: each thread gets its own buffer.

Total memory = size_kb × threads (×2 for copy: src + dst).

OPTIONS

-h  Show this help

-V  Print version and exit

-v  Verbose output (use -vv for more detail)

-s SIZE_KB
    Test only this buffer size (in KB), e.g. -s 1024 for 1MB

-f  Full sweep (test all sizes up to memory limit)
    Default: test up to 512 MB per thread

-p THREADS
    Use exactly this many threads (default: num_cpus)

-a  Auto-scaling: try different thread counts to find best
    (slower but finds optimal thread count per buffer size)

-t SECONDS
    Maximum runtime, 0 = unlimited (default: unlimited)

-r TRIES
    Repeat each test N times, report best (default: 3)

-o OP
    Run only this operation: read, write, copy, or latency
    Can be specified multiple times (default: all)

-H  Enable huge pages for large buffers (>= 4MB)
    Uses THP (no setup needed) or explicit 2MB pages
    Automatically skipped for small buffers

-R  Human-readable output with summary (default: CSV)

ENVIRONMENT VARIABLES
OpenMP Thread Affinity (environment variables):
  OMP_PROC_BIND=spread Spread threads across NUMA nodes (default)
  OMP_PLACES=cores One thread per physical core
  OMP_NUM_THREADS=N Override thread count

CSV OUTPUT
Output: CSV to stdout with columns:
  size_kb - Per-thread buffer size (KB)
  operation - read, write, copy, or latency
  bandwidth_mb_s - Aggregate bandwidth in MB/s (0 for latency)
  latency_ns - Median memory latency in ns (0 for bandwidth)
  latency_stddev_ns - Latency standard deviation in ns (0 for bandwidth)
  latency_samples - Number of samples for latency measurement
  threads - Thread count used
  iterations - Iterations performed
  elapsed_s - Elapsed time in seconds

SEE ALSO
tinymembench(1), memtester(8).