LAT_MMAP(8)
π lat_mmap β the LMBENCH girlies know
okay bestie, so this one lives in section 8 of the LMBENCH manual, and it's literally about how fast your system can make a memory mapping and then β¨unmakeβ¨ it. no cap.
πΈ NAME πΈ
lat_mmap β costs of mmapping and unmmapping varying file sizes
like... it measures the cost, the price tag, the lil tax your kernel charges every time you map stuff in and rip it back out. πΈ
π SYNOPSIS π
lat_mmap [ -P <parallelism> ] [ -W <warmups> ] [ -N <repetitions> ] size file
yeah that's the whole vibe. a size, a file, and three optional flags if you're feeling extra. π¦
β¨ DESCRIPTION β¨
okay so lat_mmap times how fast a mapping can be made and unmade. it's timing the glow-up AND the reverse glow-up, both of them.
and why do we care?? because this is a fundamental part of processes that use SunOS style shared libraries β and the way that works is: the libraries are mapped in at process start up time and unmapped at process exit. so every single time you launch a program, this whole map-and-unmap dance happens. it's giving choreography. it's giving routine. π©°
The benchmark maps in and unmaps the first size bytes of the file repeatedly and then reports the average time for one mapping/unmapping. one. single. map. one. single. unmap. averaged out over however many reps you asked for. periodt.
now about that size argument, because it's cute like this: the size specification may end with k'' or m'' to mean:
kβ kilobytes, which is* 1024mβ megabytes, which is* 1024 * 1024
so you can just say 4m and she knows. iykyk. π
π₯ OUTPUT π₯
the output format is literally "%0.2f %d\n", and the arguments in that order are megabytes then usecs. so like:
8.00 1200
that's 8.00 megabytes, 1200 microseconds. slay. β¨
π ACKNOWLEDGEMENT π
Funding for the development of this tool was provided by Sun Microsystems Computer Corporation. shoutout, we love a sponsor, we love a patron of the arts fr fr. π«Ά
π SEE ALSO π
go read the mothership bestie.
π AUTHOR π
Carl Staelin and Larry McVoy
and listen β Comments, suggestions, and bug reports are always welcome. they literally want your yapping. they want your feedback. don't be shy, the inbox is open. π
and that's the whole page!! brought to you by the LMBENCH girlies, (c)1994 Larry McVoy, dated $Date$, page LAT_MMAP(8) in the building. mwah. πβ¨
π¦ where this page comes from
- debian bookworm: lmbench 3.0-a9+debian.1-6
- debian trixie: lmbench 3.0-a9+debian.1-9
- ubuntu jammy: lmbench 3.0-a9+debian.1-6
- ubuntu noble: lmbench 3.0-a9+debian.1-6build3
- ubuntu questing: lmbench 3.0-a9+debian.1-9
- ubuntu resolute: lmbench 3.0-a9+debian.1-10
- ubuntu stonking: lmbench 3.0-a9+debian.1-10
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms