[go: nahoru, domu]

Only commit used regions of a SuperPage.

Previously, PartitionAlloc would allocate a SuperPage (2MB)
as committed even before the regions inside it were given out
to PartitionBuckets for actual use. This was wasteful, particularly
in the case of SuperPage fragmentation because these committed
bytes would be leaked by heap itself.

Because these pages are never faulted in, this had 0 impact on the
amount of RAM being used, but in Windows, due to its committed
memory model, Pagefile space was still reserved causing unnecesasry
Pagefile growth in the best case, or in the worst case for systems
with restricted pagefile size (either due to  Windows's intrinsic limit
on max Pagefile size being a small multiple of physical ram, or
adverse system policies in managed Windows deployments) it this
memory commitment could adversely affect the ability of other
programs to launch.

This CL is a patch that fixes the problem, though longer term it
would be cleaner to restructure some of the Page Allocator APIs.

Bug: 765406
Change-Id: I7b87466353b1e22735eb55e9a2af325f439d412e
Reviewed-on: https://chromium-review.googlesource.com/717942
Reviewed-by: Chris Palmer <palmer@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Albert J. Wong <ajwong@chromium.org>
Commit-Queue: Chris Palmer <palmer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#510596}
3 files changed