mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-14 16:12:15 +01:00
app/vmstorage/transport: reduce memory allocations on data ingestion path
This commit is contained in:
parent
19906dc30e
commit
0f7ece84f3
@ -395,7 +395,7 @@ type unmarshalWork struct {
|
||||
}
|
||||
|
||||
func (uw *unmarshalWork) reset() {
|
||||
if (len(uw.mrs)*4 > cap(uw.mrs) || len(uw.reqBuf)*4 > cap(uw.reqBuf)) && fasttime.UnixTimestamp()-uw.lastResetTime > 10 {
|
||||
if len(uw.reqBuf)*4 < cap(uw.reqBuf) && fasttime.UnixTimestamp()-uw.lastResetTime > 10 {
|
||||
// Periodically reset mrs and reqBuf in order to prevent from gradual memory usage growth
|
||||
// when ceratin entries in mr contain too long labels.
|
||||
// See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/490 for details.
|
||||
|
Loading…
Reference in New Issue
Block a user