* call debug.FreeOSMemory() once in 5 minutes
This commit is contained in:
2
main.go
2
main.go
@@ -40,7 +40,7 @@ func memoryUsage() {
|
|||||||
// periodically call "debug.FreeOSMemory" so
|
// periodically call "debug.FreeOSMemory" so
|
||||||
// that the OS could reclaim the free memory
|
// that the OS could reclaim the free memory
|
||||||
go func() {
|
go func() {
|
||||||
ticker := time.NewTicker(15 * time.Second)
|
ticker := time.NewTicker(5 * time.Minute)
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case t := <-ticker.C:
|
case t := <-ticker.C:
|
||||||
|
|||||||
Reference in New Issue
Block a user