From 8f1c235af540bca97467ffbbae3308fdb7cd60fe Mon Sep 17 00:00:00 2001 From: wwqgtxx Date: Thu, 12 Sep 2024 09:57:21 +0800 Subject: [PATCH] call FreeOSMemory in forceGc --- core/src/main/golang/native/main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/src/main/golang/native/main.go b/core/src/main/golang/native/main.go index 41cde8eb..c2c37547 100644 --- a/core/src/main/golang/native/main.go +++ b/core/src/main/golang/native/main.go @@ -9,6 +9,7 @@ import "C" import ( "runtime" + "runtime/debug" "cfa/native/config" "cfa/native/delegate" @@ -39,6 +40,7 @@ func reset() { tunnel.CloseAllConnections() runtime.GC() + debug.FreeOSMemory() } //export forceGc @@ -47,5 +49,6 @@ func forceGc() { log.Infoln("[APP] request force GC") runtime.GC() + debug.FreeOSMemory() }() }