From 7b7a8981a60b67794864fbe3e0597d75042a9b98 Mon Sep 17 00:00:00 2001 From: Skyxim Date: Wed, 29 Mar 2023 22:46:16 +0800 Subject: [PATCH] chore: trigger gc when the rule is loaded --- config/config.go | 4 ---- hub/executor/executor.go | 4 +--- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/config/config.go b/config/config.go index 1083839a..d2378822 100644 --- a/config/config.go +++ b/config/config.go @@ -9,7 +9,6 @@ import ( "net/url" "os" "regexp" - "runtime" "strconv" "strings" "time" @@ -821,8 +820,6 @@ func parseRules(rulesConfig []string, proxies map[string]C.Proxy, subRules map[s rules = append(rules, parsed) } - runtime.GC() - return rules, nil } @@ -1093,7 +1090,6 @@ func parseFallbackGeoSite(countries []string, rules []C.Rule) ([]*router.DomainM log.Infoln("Start initial GeoSite dns fallback filter `%s`, records: %d", country, recordsCount) } } - runtime.GC() return sites, nil } diff --git a/hub/executor/executor.go b/hub/executor/executor.go index 433882fb..8ca844d2 100644 --- a/hub/executor/executor.go +++ b/hub/executor/executor.go @@ -5,7 +5,6 @@ import ( "net/netip" "os" "runtime" - "runtime/debug" "strings" "sync" @@ -106,7 +105,7 @@ func ApplyConfig(cfg *config.Config, force bool) { loadProxyProvider(cfg.Providers) updateProfile(cfg) loadRuleProvider(cfg.RuleProviders) - debug.FreeOSMemory() + runtime.GC() tunnel.OnRunning() log.SetLevel(cfg.General.LogLevel) @@ -177,7 +176,6 @@ func updateListeners(general *config.General, listeners map[string]C.InboundList } func updateExperimental(c *config.Config) { - runtime.GC() } func updateDNS(c *config.DNS, ruleProvider map[string]provider.RuleProvider, generalIPv6 bool) {