🎨 内核垃圾回收

This commit is contained in:
Liang Ding
2023-02-04 14:58:35 +08:00
parent eea6c9468a
commit 74e7ecd5a5
8 changed files with 17 additions and 13 deletions

View File

@@ -21,7 +21,7 @@ import (
"errors"
"fmt"
"path"
"runtime"
"runtime/debug"
"sync"
"time"
@@ -128,12 +128,12 @@ func FlushQueue() {
}
if 16 < i && 0 == i%128 {
runtime.GC()
debug.FreeOSMemory()
}
}
if 128 < len(ops) {
runtime.GC()
debug.FreeOSMemory()
}
elapsed := time.Now().Sub(start).Milliseconds()