diff options
| author | Michael Anthony Knyszek <mknyszek@google.com> | 2018-10-18 20:09:03 +0000 |
|---|---|---|
| committer | Michael Knyszek <mknyszek@google.com> | 2019-05-09 16:20:52 +0000 |
| commit | eaa1c87b007ad4c19b09b5bd9fdd85a093075324 (patch) | |
| tree | aa6486c3a17290aa94e7868e2e569d2c0e907795 /src/runtime/proc.go | |
| parent | d56199d68e3f34d88dac92997662dc6d6ab6ae14 (diff) | |
| download | go-eaa1c87b007ad4c19b09b5bd9fdd85a093075324.tar.xz | |
runtime: remove periodic scavenging
This change removes the periodic scavenger which goes over every span
in the heap and scavenges it if it hasn't been used for 5 minutes. It
should no longer be necessary if we have background scavenging
(follow-up).
For #30333.
Change-Id: Ic3a1a4e85409dc25719ba4593a3b60273a4c71e0
Reviewed-on: https://go-review.googlesource.com/c/go/+/143157
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/proc.go')
| -rw-r--r-- | src/runtime/proc.go | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/src/runtime/proc.go b/src/runtime/proc.go index f314f01211..3897731164 100644 --- a/src/runtime/proc.go +++ b/src/runtime/proc.go @@ -4282,19 +4282,6 @@ func sysmon() { checkdead() unlock(&sched.lock) - // If a heap span goes unused for 5 minutes after a garbage collection, - // we hand it back to the operating system. - scavengelimit := int64(5 * 60 * 1e9) - - if debug.scavenge > 0 { - // Scavenge-a-lot for testing. - forcegcperiod = 10 * 1e6 - scavengelimit = 20 * 1e6 - } - - lastscavenge := nanotime() - nscavenge := 0 - lasttrace := int64(0) idle := 0 // how many cycles in succession we had not wokeup somebody delay := uint32(0) @@ -4316,9 +4303,6 @@ func sysmon() { // Make wake-up period small enough // for the sampling to be correct. maxsleep := forcegcperiod / 2 - if scavengelimit < forcegcperiod { - maxsleep = scavengelimit / 2 - } shouldRelax := true if osRelaxMinNS > 0 { next := timeSleepUntil() @@ -4381,12 +4365,6 @@ func sysmon() { injectglist(&list) unlock(&forcegc.lock) } - // scavenge heap once in a while - if lastscavenge+scavengelimit/2 < now { - mheap_.scavengeAll(int32(nscavenge), uint64(now), uint64(scavengelimit)) - lastscavenge = now - nscavenge++ - } if debug.schedtrace > 0 && lasttrace+int64(debug.schedtrace)*1000000 <= now { lasttrace = now schedtrace(debug.scheddetail > 0) |
