Add some GC calls
parent
01e5da085a
commit
51f3958b7d
|
@ -6,6 +6,7 @@ import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
"strings"
|
"strings"
|
||||||
|
"runtime"
|
||||||
)
|
)
|
||||||
|
|
||||||
type openPort struct {
|
type openPort struct {
|
||||||
|
@ -38,6 +39,7 @@ func main() {
|
||||||
data := make([]openPort, 0)
|
data := make([]openPort, 0)
|
||||||
|
|
||||||
for _, fin := range in {
|
for _, fin := range in {
|
||||||
|
runtime.GC()
|
||||||
log.Println("Reading file " + fin)
|
log.Println("Reading file " + fin)
|
||||||
raw, err := ioutil.ReadFile(fin)
|
raw, err := ioutil.ReadFile(fin)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -69,6 +71,9 @@ func main() {
|
||||||
odata = append(odata, h)
|
odata = append(odata, h)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
data = nil
|
||||||
|
runtime.GC()
|
||||||
|
|
||||||
log.Println("Encoding json")
|
log.Println("Encoding json")
|
||||||
raw, err := json.Marshal(odata)
|
raw, err := json.Marshal(odata)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue