a neat trick i found for reusing physical memory
Summary
The article demonstrates a Linux memory-management trick using a memory-backed file and copy-on-write mmap to duplicate memory with zero upfront physical allocations. It shows a template mapped with MAP_SHARED and then copies via MAP_PRIVATE, sharing pages until modification. The author reports that a 32 MB allocation only increases physical memory by about 32 KB when copied, and suggests exploring continuous memory regions, highlighting potential RAM efficiency tricks with low-level mmap.