Skip to content

Commit

Permalink
Merge pull request btcsuite#135 from kcalvinalvin/2024-02-06-respect-…
Browse files Browse the repository at this point in the history
…env-gogc

main: respect env gogc
  • Loading branch information
kcalvinalvin authored Feb 6, 2024
2 parents d40e352 + a53719a commit f7030b4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion utreexod.go
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,14 @@ 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(30)
// If GOGC is not explicitly set, override GC percent.
if os.Getenv("GOGC") == "" {
// Block and transaction processing can cause bursty allocations. This
// limits the garbage collector from excessively overallocating during
// bursts. This value was arrived at with the help of profiling live
// usage.
debug.SetGCPercent(30)
}

// Up some limits.
if err := limits.SetLimits(); err != nil {
Expand Down

0 comments on commit f7030b4

Please sign in to comment.