zardoz/zgc.go

27 lines
320 B
Go
Raw Permalink Normal View History

2020-10-08 21:53:05 +02:00
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.")
}
}