Skip to content

Commit

Permalink
Revert "runtime: scavenge memory upon allocating from scavenged memory"
Browse files Browse the repository at this point in the history
This reverts commit 8e093e7
(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 <[email protected]>
Reviewed-by: Austin Clements <[email protected]>
  • Loading branch information
mknyszek authored and bradfitz committed Apr 29, 2019
1 parent 438b1a5 commit fd36763
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions src/runtime/mheap.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit fd36763

Please sign in to comment.