From 6c1d24c3e5b1ed2a6cd93c5982d45a233c024f84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Sun, 1 Oct 2023 16:09:49 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=84=E7=95=99=E6=9C=80=E5=A4=A7=E5=86=85?= =?UTF-8?q?=E5=AD=98=E6=80=BB=E6=98=AF=E8=AE=BE=E7=BD=AE=E4=B8=BA=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E5=86=85=E5=AD=98=E7=9A=8420%?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/utils/system_1.19.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/internal/utils/system_1.19.go b/internal/utils/system_1.19.go index 30bfccd..af30500 100644 --- a/internal/utils/system_1.19.go +++ b/internal/utils/system_1.19.go @@ -12,12 +12,6 @@ func setMaxMemory(memoryGB int) { if memoryGB <= 0 { memoryGB = 1 } - var maxMemoryBytes int64 - if memoryGB > 10 { - maxMemoryBytes = int64(memoryGB-2) << 30 // 超过10G内存的允许剩余2G内存 - } else { - maxMemoryBytes = (int64(memoryGB) << 30) * 80 / 100 // 默认 80% - } - + var maxMemoryBytes = (int64(memoryGB) << 30) * 80 / 100 // 默认 80% debug.SetMemoryLimit(maxMemoryBytes) }