增加软内存最大值限制

This commit is contained in:
GoEdgeLab
2023-03-05 12:34:46 +08:00
parent 05d9661d3e
commit f55781f643
3 changed files with 38 additions and 0 deletions

View File

@@ -23,5 +23,11 @@ func SystemMemoryGB() int {
}
systemTotalMemory = int(stat.Total / 1024 / 1024 / 1024)
if systemTotalMemory <= 0 {
systemTotalMemory = 1
}
setMaxMemory(systemTotalMemory)
return systemTotalMemory
}