1
0
Fork 0

Add some GC calls

master
Ambrose Chua 2018-03-22 23:18:52 +08:00
parent 01e5da085a
commit 51f3958b7d
1 changed files with 5 additions and 0 deletions

View File

@ -6,6 +6,7 @@ import (
"io/ioutil"
"log"
"strings"
"runtime"
)
type openPort struct {
@ -38,6 +39,7 @@ func main() {
data := make([]openPort, 0)
for _, fin := range in {
runtime.GC()
log.Println("Reading file " + fin)
raw, err := ioutil.ReadFile(fin)
if err != nil {
@ -69,6 +71,9 @@ func main() {
odata = append(odata, h)
}
data = nil
runtime.GC()
log.Println("Encoding json")
raw, err := json.Marshal(odata)
if err != nil {