移除监控,优化GC参数

This commit is contained in:
www.xueximeng.com
2025-09-10 20:05:35 +08:00
parent 50c9ac9cad
commit 440f17df0f
21 changed files with 114 additions and 4558 deletions

View File

@@ -260,11 +260,11 @@ func getMinSizeToCompress() int {
func getGCPercent() int {
percentEnv := os.Getenv("GC_PERCENT")
if percentEnv == "" {
return 100 // 默认100%
return 50 // 默认50% - 优化内存管理更频繁的GC避免内存暴涨
}
percent, err := strconv.Atoi(percentEnv)
if err != nil || percent <= 0 {
return 100
return 50 // 错误时也使用优化后的默认值
}
return percent
}