perf(helm): reduce retained heap in release informer caches #60105
All Vouch review confidence checks passed
Residual risk 0.30 = Change Risk (0.75) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.75 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.075
Real PR Conversation Timeline
1 comments
"Review active on #60105"
general
weight: 0.35
Mathew-Estafanous
What does this PR do?
Cache compact Helm release summaries and computed tags instead of full ConfigMaps and Secrets. Update and deletion handlers use the summaries, including tombstones and custom value tags.
Functional changes
| Before | After |
| --- | --- |
| The Helm check retains encoded release payloads for every observed revision alongside its decoded summaries. | Both stores keep compact release summaries and computed tags; the full encoded payloads are released. |
Metrics, service checks, events, and Helm values mapped to tags keep their existing behavior.
Motivation
Helm release records can be large and accumulate across revisions. The check only needs metadata and computed tags after decoding them.
Describe how you validated your changes
The package tests and temporary heap regression test passed three times. The benchmark source is preserved in the dropdown below and omitted from the PR diff. Focused Go lint, Gazelle, buildifier, release-note checks, and pre-commit hooks passed. Median retained heap across three benchmark repetitions on macOS arm64:
| Storage | Values as tags | Before (100 revisions) | After (100 revisions) | Reduction |
| --- | --- | --- | --- | --- |
| configmap | false | 14,123,128 B | 131,344 B | 99.07% |
| configmap | true | 14,125,920 B | 133,792 B | 99.05% |
| secret | false | 14,133,024 B | 131,360 B | 99.07% |
| secret | true | 14,135,536 B | 133,808 B | 99.05% |
<details>
<summary>Temporary heap benchmark source and reproduction</summary>
Temporarily save the source below as
pkg/collector/corechecks/cluster/helm/cache_memory_test.go, then regenerate the local build target and run:The synthetic fixture has 100 revisions (10 releases with 10 revisions each), each containing a 128 KiB manifest and 32 KiB of values. Both cases populate the same client-go indexer and real Helm release store. The before case retains full API objects; the after case retains the compact objects. Source fixture storage is excluded from the heap delta, and both caches are kept alive through two post-population GCs. These results measure retained Go heap, not RSS or production savings; timing includes GC and is not a decoder throughput comparison.
</details>
Typed Kubernetes API unmarshalling still happens before the transform.