Browse Source

explictly invoke GC

v2ray 9 years ago
parent
commit
03d6c648ab
1 changed files with 5 additions and 2 deletions
  1. 5 2
      release/server/main.go

+ 5 - 2
release/server/main.go

@@ -5,6 +5,8 @@ import (
 	"fmt"
 	"os"
 	"path/filepath"
+	"runtime"
+	"time"
 
 	"github.com/v2ray/v2ray-core"
 	_ "github.com/v2ray/v2ray-core/app/router/rules"
@@ -92,6 +94,7 @@ func main() {
 		return
 	}
 
-	finish := make(chan bool)
-	<-finish
+	for range time.Tick(time.Minute) {
+		runtime.GC()
+	}
 }