From 16cd43ab8bea44f4bba48c59ee14c2e0b8831f88 Mon Sep 17 00:00:00 2001 From: Ciprian Dorin Craciun Date: Wed, 15 Dec 2021 19:57:49 +0200 Subject: [PATCH] [archiver] Try to configure runtime to limit resource consumption. --- sources/cmd/archiver/archiver.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sources/cmd/archiver/archiver.go b/sources/cmd/archiver/archiver.go index 0366b1d..35d03ff 100644 --- a/sources/cmd/archiver/archiver.go +++ b/sources/cmd/archiver/archiver.go @@ -11,8 +11,10 @@ import "io" import "io/ioutil" import "log" import "net/http" -import "path/filepath" import "os" +import "path/filepath" +import "runtime" +import "runtime/debug" import "sort" import "strings" import "syscall" @@ -925,6 +927,11 @@ func walkPath (_context *context, _pathResolved string, _pathInArchive string, _ func Main () () { + + runtime.GOMAXPROCS (2) + debug.SetGCPercent (75) + debug.SetMaxThreads (8) + Main_0 (main_0) }