Only decommit parts of regions and the mark array when memory is low. (#56730)
authorPeter Sollich <petersol@microsoft.com>
Wed, 4 Aug 2021 12:47:03 +0000 (14:47 +0200)
committerGitHub <noreply@github.com>
Wed, 4 Aug 2021 12:47:03 +0000 (14:47 +0200)
commitb97f4ff046f7644d31e1cae92fe60504b17fd0a6
tree9ca58fff777c17774d521f41db8c64f727f98f04
parent64689429812ed1f772589aa5abc211795493a54c
Only decommit parts of regions and the mark array when memory is low. (#56730)

We'll decommit completely free regions if they exceed the budget, but as we'll use the available memory in regions *not* on the free list preferentially, it seems smarter to decommit the tail ends of these regions only when memory is low.

In a simple GCPerfSim Scenario (-tc 10 -tagb 1000 -tlgb 1 on a 10-core box) this made about a 10% difference in run time, the time saved is mainly in the OS - VirtualFree, VirtualAlloc, and KiPageFault.
src/coreclr/gc/gc.cpp