Force GC where it seems to matter most

This commit is contained in:
Frank Denis 2020-06-09 09:41:58 +02:00
parent 8200616655
commit b794d47a76
2 changed files with 4 additions and 0 deletions

View File

@ -7,6 +7,7 @@ import (
"fmt"
"math/rand"
"os"
"runtime"
"sync"
"github.com/facebookgo/pidfile"
@ -133,6 +134,7 @@ func (app *App) AppMain() {
app.wg.Add(1)
_ = pidfile.Write()
app.proxy.StartProxy()
runtime.GC()
<-app.quit
dlog.Notice("Quit signal received...")
app.wg.Done()

View File

@ -5,6 +5,7 @@ import (
"encoding/binary"
"net"
"os"
"runtime"
"sync/atomic"
"time"
@ -253,6 +254,7 @@ func (proxy *Proxy) StartProxy() {
if liveServers > 0 {
proxy.certIgnoreTimestamp = false
}
runtime.GC()
}
}()
}