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.