diff --git a/src/runtime/mheap.go b/src/runtime/mheap.go index 3f3e36728b..114c97b874 100644 --- a/src/runtime/mheap.go +++ b/src/runtime/mheap.go @@ -1424,6 +1424,8 @@ func (h *mheap) scavengeAll() { gp := getg() gp.m.mallocing++ lock(&h.lock) + // Reset the scavenger address so we have access to the whole heap. + h.pages.resetScavengeAddr() released := h.pages.scavenge(^uintptr(0), true) unlock(&h.lock) gp.m.mallocing--