Skip to content

Commit

Permalink
call FreeOSMemory in forceGc
Browse files Browse the repository at this point in the history
  • Loading branch information
wwqgtxx committed Sep 12, 2024
1 parent c6810bc commit 8f1c235
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/src/main/golang/native/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import "C"

import (
"runtime"
"runtime/debug"

"cfa/native/config"
"cfa/native/delegate"
Expand Down Expand Up @@ -39,6 +40,7 @@ func reset() {
tunnel.CloseAllConnections()

runtime.GC()
debug.FreeOSMemory()
}

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

runtime.GC()
debug.FreeOSMemory()
}()
}

0 comments on commit 8f1c235

Please sign in to comment.