Skip to content

Reduce peak memory during edge grouping#1772

Merged
k8s-ci-robot merged 1 commit intokubernetes-sigs:mainfrom
saschagrunert:reduce-grouping-peak-memory
Mar 5, 2026
Merged

Reduce peak memory during edge grouping#1772
k8s-ci-robot merged 1 commit intokubernetes-sigs:mainfrom
saschagrunert:reduce-grouping-peak-memory

Conversation

@saschagrunert
Copy link
Copy Markdown
Member

@saschagrunert saschagrunert commented Mar 5, 2026

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

Delete edges from the input map while iterating to free memory as new data structures are built. This halves peak memory usage during groupEdgesByIdentityDigest and CheckOverlappingEdges (~1.4GB to ~700MB with ~1M edges).

Safe because Go allows map deletion during range, and all callers do not use the edges map after these functions return.

Related: kubernetes/test-infra#36582

Which issue(s) this PR fixes:

None

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Reduce peak memory usage during edge grouping by ~50%

@k8s-ci-robot k8s-ci-robot added do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Mar 5, 2026
@k8s-ci-robot k8s-ci-robot added the area/artifacts Issues or PRs related to the hosting of release artifacts for subprojects label Mar 5, 2026
@k8s-ci-robot k8s-ci-robot requested a review from puerco March 5, 2026 14:54
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. area/release-eng Issues or PRs related to the Release Engineering subproject sig/release Categorizes an issue or PR as relevant to SIG Release. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. release-note-none Denotes a PR that doesn't merit a release note. release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. release-note-none Denotes a PR that doesn't merit a release note. labels Mar 5, 2026
Delete edges from the input map while iterating to free memory
as new data structures are built. This halves peak memory usage
during groupEdgesByIdentityDigest and CheckOverlappingEdges
(~1.4GB to ~700MB with ~1M edges).

Safe because Go allows map deletion during range, and all callers
do not use the edges map after these functions return.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
@saschagrunert saschagrunert force-pushed the reduce-grouping-peak-memory branch from 2cb0707 to f44c391 Compare March 5, 2026 14:59
@saschagrunert
Copy link
Copy Markdown
Member Author

PTAL @kubernetes-sigs/release-engineering

Copy link
Copy Markdown
Member

@xmudrii xmudrii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 5, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: saschagrunert, xmudrii

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [saschagrunert,xmudrii]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit b0cef3d into kubernetes-sigs:main Mar 5, 2026
5 checks passed
@saschagrunert saschagrunert deleted the reduce-grouping-peak-memory branch March 5, 2026 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/artifacts Issues or PRs related to the hosting of release artifacts for subprojects area/release-eng Issues or PRs related to the Release Engineering subproject cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/release Categorizes an issue or PR as relevant to SIG Release. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants