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.
Heap equals RSS equals Dirty, all at 4GB after initial buffer allocation.
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!