1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-30 05:56:54 -05:00

trigger GC after loading

This commit is contained in:
Darien Raymond 2018-11-16 17:17:11 +01:00
parent 248099eca5
commit 14646940a0
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -8,6 +8,7 @@ import (
"os"
"os/signal"
"path/filepath"
"runtime"
"strings"
"syscall"
@ -119,6 +120,9 @@ func main() {
os.Exit(-1)
}
// Explicitly triggering GC to remove garbage from config loading.
runtime.GC()
osSignals := make(chan os.Signal, 1)
signal.Notify(osSignals, os.Interrupt, os.Kill, syscall.SIGTERM)