More aggressive GC.
[lightning.git] / cmd.go
diff --git a/cmd.go b/cmd.go
index eeeb6fb740f5d2d334534043e4aff6788ef2ab3d..b10b1caa3fc4a65531de88e6818013a628380494 100644 (file)
--- a/cmd.go
+++ b/cmd.go
@@ -10,6 +10,7 @@ import (
        "io/ioutil"
        "os"
        "os/exec"
+       "runtime/debug"
        "strings"
 
        "git.arvados.org/arvados.git/lib/cmd"
@@ -46,6 +47,12 @@ var (
        })
 )
 
+func init() {
+       if os.Getenv("GOGC") == "" {
+               debug.SetGCPercent(30)
+       }
+}
+
 func Main() {
        if !isatty.IsTerminal(os.Stderr.Fd()) {
                logrus.StandardLogger().Formatter = &logrus.TextFormatter{DisableTimestamp: true}