mirror of
https://github.com/btcsuite/btcd.git
synced 2026-08-13 12:32:51 +02:00
btcd: don't override explicitly set GOGC
If GOGC env var is explicitly set, use it. Otherwise, set GC to 10% (default).
This commit is contained in:
parent
85b6f7ed2a
commit
3986702b97
1 changed files with 8 additions and 5 deletions
13
btcd.go
13
btcd.go
|
|
@ -328,11 +328,14 @@ func init() {
|
|||
}
|
||||
|
||||
func main() {
|
||||
// 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(10)
|
||||
// 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(10)
|
||||
}
|
||||
|
||||
// Up some limits.
|
||||
if err := limits.SetLimits(); err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue