From b0a5c51b959d5849377354563405a88a770e1f33 Mon Sep 17 00:00:00 2001 From: Mark Nevill Date: Mon, 9 Dec 2019 10:32:40 +0000 Subject: [PATCH] Return unused point slice to pool in Call and VectorSelector eval. (#6427) Signed-off-by: Mark Nevill --- promql/engine.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/promql/engine.go b/promql/engine.go index d64118613..adc0954b1 100644 --- a/promql/engine.go +++ b/promql/engine.go @@ -1070,6 +1070,8 @@ func (ev *evaluator) eval(expr Expr) Value { } else { ev.error(ErrTooManySamples(env)) } + } else { + putPointSlice(ss.Points) } } if mat.ContainsSameLabelset() { @@ -1165,6 +1167,8 @@ func (ev *evaluator) eval(expr Expr) Value { if len(ss.Points) > 0 { mat = append(mat, ss) + } else { + putPointSlice(ss.Points) } }