From 40afef8b9e076fed4200f2aaa1cb2ab7c46b5b57 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Mon, 17 Feb 2020 17:37:35 -0800 Subject: [PATCH] Only set gc percent if the flag is set (#4899) * only set gc percent if the flag is set --- beacon-chain/main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/beacon-chain/main.go b/beacon-chain/main.go index 81cfa7490a..84de0bd3a1 100644 --- a/beacon-chain/main.go +++ b/beacon-chain/main.go @@ -127,7 +127,9 @@ func main() { } } - runtimeDebug.SetGCPercent(ctx.GlobalInt(flags.SetGCPercent.Name)) + if ctx.IsSet(flags.SetGCPercent.Name) { + runtimeDebug.SetGCPercent(ctx.GlobalInt(flags.SetGCPercent.Name)) + } runtime.GOMAXPROCS(runtime.NumCPU()) return debug.Setup(ctx) }