From 4a8367ce3a9a8321ceeffbf2934380b139a74f90 Mon Sep 17 00:00:00 2001 From: jingrui Date: Fri, 18 Oct 2019 14:49:47 +0800 Subject: [PATCH] containerd: stw gc sweep for arm64 Change-Id: I855c13a21c72bf0e91563db7c11e1348a1a78d55 Signed-off-by: jingrui --- cmd/containerd-shim/main_unix.go | 5 ----- runtime/v1/shim/client/client.go | 4 ++++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/cmd/containerd-shim/main_unix.go b/cmd/containerd-shim/main_unix.go index 89f6be91..22283626 100644 --- a/cmd/containerd-shim/main_unix.go +++ b/cmd/containerd-shim/main_unix.go @@ -80,11 +80,6 @@ func init() { func main() { debug.SetGCPercent(40) - go func() { - for range time.Tick(30 * time.Second) { - debug.FreeOSMemory() - } - }() if debugFlag { logrus.SetLevel(logrus.DebugLevel) diff --git a/runtime/v1/shim/client/client.go b/runtime/v1/shim/client/client.go index a819be6c..a4669d33 100644 --- a/runtime/v1/shim/client/client.go +++ b/runtime/v1/shim/client/client.go @@ -24,6 +24,7 @@ import ( "net" "os" "os/exec" + "runtime" "strings" "sync" "syscall" @@ -161,6 +162,9 @@ func newCommand(binary, daemonAddress string, debug bool, config shim.Config, so cmd.SysProcAttr = getSysProcAttr() cmd.ExtraFiles = append(cmd.ExtraFiles, socket) cmd.Env = append(os.Environ(), "GOMAXPROCS=2") + if runtime.GOARCH == "arm64" { + cmd.Env = append(cmd.Env, "GODEBUG=gcstoptheworld=2") + } cmd.Stdout = stdout cmd.Stderr = stderr return cmd, nil -- 2.17.1