From 479675b6ccffbd9505a1edced40472438ea6a737 Mon Sep 17 00:00:00 2001 From: Andrey Meshkov Date: Wed, 24 Jul 2019 17:00:05 +0300 Subject: [PATCH] =?UTF-8?q?refactor:=20=F0=9F=92=A1=20optimizing=20GC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Setting debug.SetGCPercent makes golang free memory faster. This greatly improves overall RSS usage. Otherwise, golang prefers not to free memory at all:) --- main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.go b/main.go index 717fa8e3..823890ea 100644 --- a/main.go +++ b/main.go @@ -1,6 +1,8 @@ package main import ( + "runtime/debug" + "github.com/AdguardTeam/AdGuardHome/home" ) @@ -11,5 +13,6 @@ var version = "undefined" var channel = "release" func main() { + debug.SetGCPercent(10) home.Main(version, channel) }