aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/proc.c
diff options
context:
space:
mode:
authorDmitriy Vyukov <dvyukov@google.com>2014-08-25 23:30:39 +0400
committerDmitriy Vyukov <dvyukov@google.com>2014-08-25 23:30:39 +0400
commitb2c43438d20bafda5c6fee777342371d1685e5cc (patch)
treef2ade2e714994c2dd5ecac1dba9a9ae4fb9a047b /src/pkg/runtime/proc.c
parent21a4bdef2fa2ae5425c8d309a8e914e3e514c30a (diff)
downloadgo-b2c43438d20bafda5c6fee777342371d1685e5cc.tar.xz
runtime: restore scavenger constants
Once and for all. Broken in cl/108640043. I've messed it before. To test scavenger-related changes one needs to alter the constants during final testing. And then it's very easy to submit with the altered constants. LGTM=rsc R=golang-codereviews CC=golang-codereviews, rsc https://golang.org/cl/136720044
Diffstat (limited to 'src/pkg/runtime/proc.c')
-rw-r--r--src/pkg/runtime/proc.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/pkg/runtime/proc.c b/src/pkg/runtime/proc.c
index ce0f74aa6c..483903d6d9 100644
--- a/src/pkg/runtime/proc.c
+++ b/src/pkg/runtime/proc.c
@@ -2632,10 +2632,15 @@ sysmon(void)
G *gp;
// If we go two minutes without a garbage collection, force one to run.
- forcegcperiod = 2*60*1e6;
+ forcegcperiod = 2*60*1e9;
// If a heap span goes unused for 5 minutes after a garbage collection,
// we hand it back to the operating system.
- scavengelimit = 5*60*1e6;
+ scavengelimit = 5*60*1e9;
+ if(runtime·debug.scavenge > 0) {
+ // Scavenge-a-lot for testing.
+ forcegcperiod = 10*1e6;
+ scavengelimit = 20*1e6;
+ }
lastscavenge = runtime·nanotime();
nscavenge = 0;
// Make wake-up period small enough for the sampling to be correct.