aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Knyszek <mknyszek@google.com>2019-04-26 15:53:44 +0000
committerBrad Fitzpatrick <bradfitz@golang.org>2019-04-29 23:06:42 +0000
commitfd3676302e8436ec9243ae0695582bbb3f31dc3a (patch)
treeef760bfd52c288e45bd6b385891818decf582e0d
parent438b1a5dae01812a2b91b648c762414d4854ccd7 (diff)
downloadgo-fd3676302e8436ec9243ae0695582bbb3f31dc3a.tar.gz
go-fd3676302e8436ec9243ae0695582bbb3f31dc3a.zip
Revert "runtime: scavenge memory upon allocating from scavenged memory"
This reverts commit 8e093e7a1cd8a092f23717cb8f34bca489a3eee5 (CL 159500). Reason for revert: Increases memory allocation latency in certain situations. Fixes #31679. Change-Id: I15e02c53a58009fd907b619b8649de2cdeb29ef0 Reviewed-on: https://go-review.googlesource.com/c/go/+/174102 Run-TryBot: Michael Knyszek <mknyszek@google.com> Reviewed-by: Austin Clements <austin@google.com>
-rw-r--r--src/runtime/mheap.go10
1 files changed, 0 insertions, 10 deletions
diff --git a/src/runtime/mheap.go b/src/runtime/mheap.go
index 47e3a33391..6c0ea1bded 100644
--- a/src/runtime/mheap.go
+++ b/src/runtime/mheap.go
@@ -1198,16 +1198,6 @@ HaveSpan:
// heap_released since we already did so earlier.
sysUsed(unsafe.Pointer(s.base()), s.npages<<_PageShift)
s.scavenged = false
-
- // Since we allocated out of a scavenged span, we just
- // grew the RSS. Mitigate this by scavenging enough free
- // space to make up for it.
- //
- // Also, scavengeLargest may cause coalescing, so prevent
- // coalescing with s by temporarily changing its state.
- s.state = mSpanManual
- h.scavengeLargest(s.npages * pageSize)
- s.state = mSpanFree
}
s.unusedsince = 0