mirror of
https://git.keinpfusch.net/loweel/zorg
synced 2024-12-18 15:58:35 +01:00
27 lines
308 B
Go
27 lines
308 B
Go
|
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.")
|
||
|
}
|
||
|
|
||
|
}
|