Skip to content
small playground to show case mmap and its effect on memory consumption and runtime for a specific workload
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
CMakeLists.txt
LICENSE
README.md
mem.log.mmap
mem.log.no_mmap
mmap.png
mmap.txt
mmap_demo.cpp
no_mmap.png
no_mmap.txt

README.md

mmap_demo

Small playground to show case mmap and its effect on memory consumption and runtime for a specific workload.

Build, then run either without args to run without mmapping, or pass 'mmap' as the first CLI arg to enable mmaping.

To measure time/RSS, use /usr/bin/time -v. For more detailed memory tracking, use pmap sampling e.g. via 1 and 2.

no mmap

no mmap

Heap equals RSS equals Dirty, all at 4GB after initial buffer allocation.

mmap

no mmap

RSS goes up to 4GB at the end, but only ~1GB is dirty at most, the rest apparently gets discarded early by the kernel. A bit faster too!

You can’t perform that action at this time.