zorg/0_gc.go

27 lines
308 B
Go
Raw Normal View History

2020-10-08 14:33:26 -05:00
package main
import (
"log"
"runtime"
"time"
)
func init() {
log.Println("Garbage Collector Thread Starting")
go memoryCleanerThread()
}
func memoryCleanerThread() {
for {
time.Sleep(Zint)
log.Println("Time to clean memory...")
runtime.GC()
log.Println("Garbage Collection done.")
}
}