Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace VirtualFree(DECOMMIT) with DiscardVirtualMemory in Purge().
Windows does not allow page-file backed memory-mapped file pages to be de-committed, so the call to VirtualFree(MEM_DECOMMIT) always fails. Windows 8.1 and above provide DiscardVirtualMemory(), which releases the underlying storage for pages without decommitting them. This is equivalent to swapping-out the pages, freeing up the physical memory they occupied, but without any actual paging activity, since their contents are being lost. The pages continue to be accounted against the system's total commit charge, so this won't prevent apps OOMing if the available commit charge is low. Bug: 747657 Change-Id: Icf6d4b16c1adcc545b09bad207a9abd4a97e4726 Reviewed-on: https://chromium-review.googlesource.com/615062 Reviewed-by: Daniel Cheng <dcheng@chromium.org> Reviewed-by: Penny MacNeil <pennymac@chromium.org> Commit-Queue: Penny MacNeil <pennymac@chromium.org> Cr-Commit-Position: refs/heads/master@{#495691}
- Loading branch information