From 692dae1c2c766e258538abc57e839d3143162fa1 Mon Sep 17 00:00:00 2001 From: "agent-platform-auto-pr[bot]" <153269286+agent-platform-auto-pr[bot]@users.noreply.github.com> Date: Sat, 14 Sep 2024 17:38:25 +0000 Subject: [PATCH] [Backport 7.58.x] Fix memory leak caused by container check (#29355) Co-authored-by: sblumenthal --- .../containers/generic/processor_network.go | 1 + .../fix-container-check-memleak-d9ff028d5499197c.yaml | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 releasenotes/notes/fix-container-check-memleak-d9ff028d5499197c.yaml diff --git a/pkg/collector/corechecks/containers/generic/processor_network.go b/pkg/collector/corechecks/containers/generic/processor_network.go index 12d9538d4b5cf3..d83fd0f2150435 100644 --- a/pkg/collector/corechecks/containers/generic/processor_network.go +++ b/pkg/collector/corechecks/containers/generic/processor_network.go @@ -87,6 +87,7 @@ func (pn *ProcessorNetwork) processGroupedContainerNetwork() { for _, containerNetwork := range pn.ungroupedContainerNetwork { pn.generateNetworkMetrics(containerNetwork.tags, containerNetwork.stats) } + pn.ungroupedContainerNetwork = nil for _, containerNetworks := range pn.groupedContainerNetwork { // If we have multiple containers, tagging with container tag is incorrect as the metrics refer to whole isolation group. diff --git a/releasenotes/notes/fix-container-check-memleak-d9ff028d5499197c.yaml b/releasenotes/notes/fix-container-check-memleak-d9ff028d5499197c.yaml new file mode 100644 index 00000000000000..1166a23c8be7e8 --- /dev/null +++ b/releasenotes/notes/fix-container-check-memleak-d9ff028d5499197c.yaml @@ -0,0 +1,11 @@ +# Each section from every release note are combined when the +# CHANGELOG.rst is rendered. So the text needs to be worded so that +# it does not depend on any information only available in another +# section. This may mean repeating some details, but each section +# must be readable independently of the other. +# +# Each section note must be formatted as reStructuredText. +--- +fixes: + - | + Fixes memory leak caused by container check.