News for hackers. Stuff that matters.
Re:A queue of page faults (2014) by MarkSweep on Wednesday June 15, 2016 @01:17AM (#11907287)
Zeroing the pages is not nessisarily the bottleneck here, as Windows has a background thread that will zero memory as it is freed. The problem is the initial allocation just sets up the virtual address space without backing those virtual pages with physical pages. Upon accessing the pages for the first time a page fault has to find a physical page to use.

According to MSDN, even when you use MEM_COMMIT: "The function also guarantees that when the caller later initially accesses the memory, the contents will be zero. Actual physical pages are not allocated unless/until the virtual addresses are actually accessed."

https://msdn.microsoft.com/en-us/library/windows/desktop/aa3...

There are no comments on this comment yet.