Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
SleepyHeeead committed Jan 29, 2024
1 parent 798219b commit 68360e2
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,6 @@ var redisClient redis.Conn

func main() {
gin.SetMode(gin.ReleaseMode)

// GC 优化
ballast := make([]byte, 1<<30) // 分配 1G 内存,不会实际占用物理内存,不可该读写变量
defer func() {
log.Println("ballast len %v", len(ballast))
}()

router := gin.Default()

// Log 收集中间件
Expand Down Expand Up @@ -181,7 +174,7 @@ func main() {
})

// GC 优化
ballast := make([]byte, 1<<27) // 分配 128M 内存,不会实际占用物理内存,不可读写该变量
ballast := make([]byte, 1<<30) // 分配 1G 内存,不会实际占用物理内存,不可读写该变量
defer func() {
log.Println("ballast len %v", len(ballast))
}()
Expand Down

0 comments on commit 68360e2

Please sign in to comment.