mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-05 09:30:26 +08:00
优化可用内存检查
This commit is contained in:
@@ -40,7 +40,7 @@ func (this *NodeStatusExecutor) updateMem(status *nodeconfigs.NodeStatus) {
|
|||||||
if minFreeMemory > 1<<30 {
|
if minFreeMemory > 1<<30 {
|
||||||
minFreeMemory = 1 << 30
|
minFreeMemory = 1 << 30
|
||||||
}
|
}
|
||||||
if stat.Free < minFreeMemory {
|
if stat.Available > 0 && stat.Available < minFreeMemory {
|
||||||
runtime.GC()
|
runtime.GC()
|
||||||
debug.FreeOSMemory()
|
debug.FreeOSMemory()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user