[lbry] runtime: Allow environment var GOGC=<percent> to override hard-coded SetGCPercent(10).

This commit is contained in:
Jonathan Moody 2022-06-03 12:19:55 -04:00 committed by GitHub
parent 8f95946b17
commit 92a7a2087a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -281,7 +281,9 @@ func main() {
// limits the garbage collector from excessively overallocating during // limits the garbage collector from excessively overallocating during
// bursts. This value was arrived at with the help of profiling live // bursts. This value was arrived at with the help of profiling live
// usage. // usage.
debug.SetGCPercent(10) if _, ok := os.LookupEnv("GOGC"); !ok {
debug.SetGCPercent(10)
}
// Up some limits. // Up some limits.
if err := limits.SetLimits(); err != nil { if err := limits.SetLimits(); err != nil {