zardoz/zgc.go
2019-11-22 11:35:16 +01:00

26 lines
320 B
Go

package main
import (
"log"
"runtime"
"time"
)
func init() {
log.Println("Garbage Collector Thread Starting")
go memoryCleanerThread()
}
func memoryCleanerThread() {
for {
time.Sleep(10 * time.Minute)
log.Println("Time to clean memory...")
runtime.GC()
log.Println("Garbage Collection done.")
}
}