mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-02 15:36:41 -05:00
trigger GC after loading
This commit is contained in:
parent
248099eca5
commit
14646940a0
@ -8,6 +8,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
@ -119,6 +120,9 @@ func main() {
|
|||||||
os.Exit(-1)
|
os.Exit(-1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Explicitly triggering GC to remove garbage from config loading.
|
||||||
|
runtime.GC()
|
||||||
|
|
||||||
osSignals := make(chan os.Signal, 1)
|
osSignals := make(chan os.Signal, 1)
|
||||||
signal.Notify(osSignals, os.Interrupt, os.Kill, syscall.SIGTERM)
|
signal.Notify(osSignals, os.Interrupt, os.Kill, syscall.SIGTERM)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user