mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-01-20 07:19:17 +01:00
lib/mergeset: help GC by removing refereces to slices in inmemoryBlock.Reset
This commit is contained in:
parent
8a057e705a
commit
7119f294f3
@ -31,6 +31,12 @@ type inmemoryBlock struct {
|
||||
func (ib *inmemoryBlock) Reset() {
|
||||
ib.commonPrefix = ib.commonPrefix[:0]
|
||||
ib.data = ib.data[:0]
|
||||
|
||||
items := ib.items
|
||||
for i := range items {
|
||||
// Remove reference to by slice, so GC could free the byte slice.
|
||||
items[i] = nil
|
||||
}
|
||||
ib.items = ib.items[:0]
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user