Update main.go

This commit is contained in:
Carey Wong 2023-10-08 22:51:04 -05:00 committed by GitHub
parent c926de6e85
commit 5e829391f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -173,6 +173,12 @@ func main() {
} }
}) })
// GC 优化
ballast := make([]byte, 1<<27) // 分配 128M 内存,不会实际占用物理内存,不可读写该变量
defer func() {
log.Println("ballast len %v", len(ballast))
}()
router.Run(fmt.Sprintf(":%d", *port)) router.Run(fmt.Sprintf(":%d", *port))
} }