mirror of
https://git.keinpfusch.net/loweel/zabov
synced 2025-02-16 13:40:36 +01:00
27 lines
320 B
Go
27 lines
320 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"runtime"
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
func init() {
|
||
|
|
||
|
fmt.Println("Garbage Collector Thread Starting")
|
||
|
|
||
|
go memoryCleanerThread()
|
||
|
|
||
|
}
|
||
|
|
||
|
func memoryCleanerThread() {
|
||
|
|
||
|
for {
|
||
|
time.Sleep(10 * time.Minute)
|
||
|
fmt.Println("Time to clean memory...")
|
||
|
runtime.GC()
|
||
|
fmt.Println("Garbage Collection done.")
|
||
|
}
|
||
|
|
||
|
}
|