mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-03-11 15:34:56 +00:00
app/vmselect/netstorage: protect from too smart compiler, which may break memory usage optimization in tmpBlocksFileWrapper.WriteBlocks
This commit is contained in:
parent
0750d2cec1
commit
16a4b1b20c
1 changed files with 2 additions and 3 deletions
|
@ -896,9 +896,8 @@ func (tbfw *tmpBlocksFileWrapper) WriteBlock(mb *storage.MetricBlock) error {
|
|||
} else {
|
||||
// An optimization for big number of time series with long names: store only a single copy of metricNameStr
|
||||
// in both tbfw.orderedMetricNames and tbfw.m.
|
||||
metricNameStr := string(metricName)
|
||||
tbfw.orderedMetricNames = append(tbfw.orderedMetricNames, metricNameStr)
|
||||
tbfw.m[metricNameStr] = addrs
|
||||
tbfw.orderedMetricNames = append(tbfw.orderedMetricNames, string(metricName))
|
||||
tbfw.m[tbfw.orderedMetricNames[len(tbfw.orderedMetricNames)-1]] = addrs
|
||||
}
|
||||
}
|
||||
tbfw.mu.Unlock()
|
||||
|
|
Loading…
Reference in a new issue