Merge pull request #2055 from stevvooe/aggressive-memory-shim

cmd/containerd-shim: aggressive memory reclamation
This commit is contained in:
Stephen Day 2018-01-24 16:06:57 -08:00 committed by GitHub
commit 3fcc52b091
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,9 +12,11 @@ import (
"os/exec"
"os/signal"
"runtime"
"runtime/debug"
"strings"
"sync"
"syscall"
"time"
"github.com/containerd/containerd/events"
"github.com/containerd/containerd/linux/proc"
@ -58,6 +60,13 @@ func init() {
}
func main() {
debug.SetGCPercent(10)
go func() {
for range time.Tick(30 * time.Second) {
debug.FreeOSMemory()
}
}()
if debugFlag {
logrus.SetLevel(logrus.DebugLevel)
}