From 10cc6bea0011f02f36cdbba5a97ec78ec17c87c6 Mon Sep 17 00:00:00 2001 From: dengzhiwen1 Date: Tue, 13 Apr 2021 10:59:35 +0800 Subject: [PATCH] Fix the zlibWriterPools doesn't work leads to high memory usage --- internal/utils/compression.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/utils/compression.go b/internal/utils/compression.go index 4ad2ceda..379cdf2f 100644 --- a/internal/utils/compression.go +++ b/internal/utils/compression.go @@ -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()