diff options
author | Michael Anthony Knyszek <mknyszek@google.com> | 2019-11-18 19:23:39 +0000 |
---|---|---|
committer | Michael Knyszek <mknyszek@google.com> | 2019-12-11 19:51:34 +0000 |
commit | 1b1fbb3192984624871ab92518499d4bd6e6e65c (patch) | |
tree | f1e93f188aecabe9aeb43cf82d70aea500314aed /src/runtime/export_test.go | |
parent | 6f2b8347b148bb7aab1a89423d18ec0cbca6ffb4 (diff) | |
download | go-1b1fbb3192984624871ab92518499d4bd6e6e65c.tar.gz go-1b1fbb3192984624871ab92518499d4bd6e6e65c.zip |
runtime: use inUse ranges to map in summary memory only as needed
Prior to this change, if the heap was very discontiguous (such as in
TestArenaCollision) it's possible we could map a large amount of memory
as R/W and commit it. We would use only the start and end to track what
should be mapped, and we would extend that mapping as needed to
accomodate a potentially fragmented address space.
After this change, we only map exactly the part of the summary arrays
that we need by using the inUse ranges from the previous change. This
reduces the GCSys footprint of TestArenaCollision from 300 MiB to 18
MiB.
Because summaries are no longer mapped contiguously, this means the
scavenger can no longer iterate directly. This change also updates the
scavenger to borrow ranges out of inUse and iterate over only the
parts of the heap which are actually currently in use. This is both an
optimization and necessary for correctness.
Fixes #35514.
Change-Id: I96bf0c73ed0d2d89a00202ece7b9d089a53bac90
Reviewed-on: https://go-review.googlesource.com/c/go/+/207758
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'src/runtime/export_test.go')
-rw-r--r-- | src/runtime/export_test.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/runtime/export_test.go b/src/runtime/export_test.go index d8cf2acad8..ce9c6a0ba7 100644 --- a/src/runtime/export_test.go +++ b/src/runtime/export_test.go @@ -578,6 +578,7 @@ func RunGetgThreadSwitchTest() { const ( PageSize = pageSize PallocChunkPages = pallocChunkPages + PageAlloc64Bit = pageAlloc64Bit ) // Expose pallocSum for testing. |