mirror of
				https://github.com/TeaOSLab/EdgeAPI.git
				synced 2025-11-04 16:00:24 +08:00 
			
		
		
		
	优化可用内存检查
This commit is contained in:
		@@ -1,3 +1,4 @@
 | 
			
		||||
//go:build !windows
 | 
			
		||||
// +build !windows
 | 
			
		||||
 | 
			
		||||
package nodes
 | 
			
		||||
@@ -31,7 +32,7 @@ func (this *NodeStatusExecutor) updateMem(status *nodeconfigs.NodeStatus) {
 | 
			
		||||
		if minFreeMemory > 1<<30 {
 | 
			
		||||
			minFreeMemory = 1 << 30
 | 
			
		||||
		}
 | 
			
		||||
		if stat.Free < minFreeMemory {
 | 
			
		||||
		if stat.Available > 0 && stat.Available < minFreeMemory {
 | 
			
		||||
			runtime.GC()
 | 
			
		||||
			debug.FreeOSMemory()
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user