Add some GC calls
parent
01e5da085a
commit
51f3958b7d
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue