mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-12-08 19:00:54 +08:00
修改软内存限制设置错误
This commit is contained in:
@@ -16,7 +16,7 @@ func setMaxMemory(memoryGB int) {
|
|||||||
if memoryGB > 10 {
|
if memoryGB > 10 {
|
||||||
maxMemoryBytes = int64(memoryGB-2) << 30 // 超过10G内存的允许剩余2G内存
|
maxMemoryBytes = int64(memoryGB-2) << 30 // 超过10G内存的允许剩余2G内存
|
||||||
} else {
|
} else {
|
||||||
maxMemoryBytes = (int64(memoryGB) << 30) * 100 / 80 // 默认 80%
|
maxMemoryBytes = (int64(memoryGB) << 30) * 80 / 100 // 默认 80%
|
||||||
}
|
}
|
||||||
|
|
||||||
debug.SetMemoryLimit(maxMemoryBytes)
|
debug.SetMemoryLimit(maxMemoryBytes)
|
||||||
|
|||||||
Reference in New Issue
Block a user