Skip to content

Commit

Permalink
Fix the zlibWriterPools doesn't work leads to high memory usage
Browse files Browse the repository at this point in the history
  • Loading branch information
dengzhiwen1 committed Apr 13, 2021
1 parent d6e66a2 commit 10cc6be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/utils/compression.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func Compress(raw []byte, compressLevel int) ([]byte, error) {

buf := bufPool.Get().(*bytes.Buffer)
defer bufPool.Put(buf)
writerPool := zlibWriterPools[compressLevel-1]
writerPool := &zlibWriterPools[compressLevel-1]
writer := writerPool.Get().(*zlib.Writer)
defer writerPool.Put(writer)
buf.Reset()
Expand Down

0 comments on commit 10cc6be

Please sign in to comment.