Newer
Older
zabov / 00.memory.go
Loweel on 17 Aug 320 bytes first commit
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.")
	}

}