From 92a7a2087ae17c692b2d7cfeaeeb03d0a30d3074 Mon Sep 17 00:00:00 2001 From: Jonathan Moody <103143855+moodyjon@users.noreply.github.com> Date: Fri, 3 Jun 2022 12:19:55 -0400 Subject: [PATCH] [lbry] runtime: Allow environment var GOGC= to override hard-coded SetGCPercent(10). --- lbcd.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lbcd.go b/lbcd.go index 1110eeab..b9606653 100644 --- a/lbcd.go +++ b/lbcd.go @@ -281,7 +281,9 @@ func main() { // limits the garbage collector from excessively overallocating during // bursts. This value was arrived at with the help of profiling live // usage. - debug.SetGCPercent(10) + if _, ok := os.LookupEnv("GOGC"); !ok { + debug.SetGCPercent(10) + } // Up some limits. if err := limits.SetLimits(); err != nil {