Skip to content

Commit 8f1c235

Browse files
committed
call FreeOSMemory in forceGc
1 parent c6810bc commit 8f1c235

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

core/src/main/golang/native/main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import "C"
99

1010
import (
1111
"runtime"
12+
"runtime/debug"
1213

1314
"cfa/native/config"
1415
"cfa/native/delegate"
@@ -39,6 +40,7 @@ func reset() {
3940
tunnel.CloseAllConnections()
4041

4142
runtime.GC()
43+
debug.FreeOSMemory()
4244
}
4345

4446
//export forceGc
@@ -47,5 +49,6 @@ func forceGc() {
4749
log.Infoln("[APP] request force GC")
4850

4951
runtime.GC()
52+
debug.FreeOSMemory()
5053
}()
5154
}

0 commit comments

Comments
 (0)