diff --git a/pkg/statistics/fmsketch.go b/pkg/statistics/fmsketch.go index 74ee24a922c70..bd0a43d52f08c 100644 --- a/pkg/statistics/fmsketch.go +++ b/pkg/statistics/fmsketch.go @@ -213,16 +213,7 @@ func (s *FMSketch) MemoryUsage() (sum int64) { } func (s *FMSketch) reset() { - // not use hashset.Clear, it will release all memory and Not conducive to memory reuse. - // the size of set is not more than 10000. - set := make([]uint64, 0, s.hashset.Count()) - s.hashset.Iter(func(k uint64, v bool) (stop bool) { - set = append(set, k) - return false - }) - for _, k := range set { - s.hashset.Delete(k) - } + s.hashset.Clear() s.mask = 0 s.maxSize = 0 }