From b2c43438d20bafda5c6fee777342371d1685e5cc Mon Sep 17 00:00:00 2001 From: Dmitriy Vyukov Date: Mon, 25 Aug 2014 23:30:39 +0400 Subject: 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 --- src/pkg/runtime/proc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/pkg/runtime/proc.c') 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. -- cgit v1.3-5-g9baa