Gradual decommit in wks (#73620)
authorPeter Sollich <petersol@microsoft.com>
Wed, 28 Sep 2022 14:33:11 +0000 (16:33 +0200)
committerGitHub <noreply@github.com>
Wed, 28 Sep 2022 14:33:11 +0000 (07:33 -0700)
commit84da2ff509e2c48d5f76089060e7ed1980be2176
tree2d333cb15514ef545903986a1407de95902346bd
parent6600d1dad79414ecdf77e561d6e05ab3286918d5
Gradual decommit in wks (#73620)

* Initial version of gradual decommit for WKS.

This is the regions version modeled after the behavior of the segments version.

Idea is simply to limit the amount of decommitted memory based on the time since the last GC.

* Change decommit_step to take a step_milliseconds parameter - this makes the logic for the WKS decommit more straightforward.

* Only do decommits at most every 100 milliseconds to limit the number of decommitted regions.

* Address code review feedback: disable the logic in decommit_ephemeral_segment_pages for WKS, some changes in distribute_free_regions as a consequence.

* Remove unused static field ephemeral_elapsed.

* Fix typo in comment.
src/coreclr/gc/gc.cpp
src/coreclr/gc/gcpriv.h