refactor: 💡 optimizing GC

Setting debug.SetGCPercent makes golang free memory faster. This greatly
improves overall RSS usage. Otherwise, golang prefers not to free memory
at all:)
This commit is contained in:
Andrey Meshkov 2019-07-24 17:00:05 +03:00
parent c2dacd32d1
commit 479675b6cc
1 changed files with 3 additions and 0 deletions

View File

@ -1,6 +1,8 @@
package main package main
import ( import (
"runtime/debug"
"github.com/AdguardTeam/AdGuardHome/home" "github.com/AdguardTeam/AdGuardHome/home"
) )
@ -11,5 +13,6 @@ var version = "undefined"
var channel = "release" var channel = "release"
func main() { func main() {
debug.SetGCPercent(10)
home.Main(version, channel) home.Main(version, channel)
} }