优化代码

This commit is contained in:
刘祥超
2023-10-02 08:18:43 +08:00
parent 125ad9c606
commit 3781b1920a
4 changed files with 4 additions and 5 deletions

View File

@@ -12,6 +12,7 @@ func setMaxMemory(memoryGB int) {
if memoryGB <= 0 {
memoryGB = 1
}
var maxMemoryBytes = (int64(memoryGB) << 30) * 80 / 100 // 默认 80%
var maxMemoryBytes = (int64(memoryGB) << 30) * 75 / 100 // 默认 75%
debug.SetMemoryLimit(maxMemoryBytes)
}