Skip to content

Commit

Permalink
fix: Add copyString function to symbolizer to avoid retaining memory (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
cyriltovena committed Jun 6, 2024
1 parent 1b80458 commit 86b119a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/chunkenc/symbols.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"hash"
"io"
"strings"
"sync"

"github.com/pkg/errors"
Expand Down Expand Up @@ -78,6 +79,7 @@ func (s *symbolizer) add(lbl string) uint32 {

idx, ok = s.symbolsMap[lbl]
if !ok {
lbl = strings.Clone(lbl)
idx = uint32(len(s.labels))
s.symbolsMap[lbl] = idx
s.labels = append(s.labels, lbl)
Expand Down

0 comments on commit 86b119a

Please sign in to comment.