3 ms·
Even better: use mmap to allocate a virtual huge array, which initially will use no memory at all, and let the OS allocate physical pages to it as needed.
by hikarudo 7y ago
Even better: use mmap to allocate a virtual huge array, which initially will use no memory at all, and let the OS allocate physical pages to it as needed.
- ncmncm 7y agoIt takes active effort to get all the pages faulted in at startup, and not lazily. Some of us do that, to take the latency hit just the one time: MAP_POPULATE.