Skip to content

Memory leak in source-controller v1.5.0 #1867

@dan0sh

Description

@dan0sh

Observed behavior

In one of our clusters, source-controller memory usage grows linearly over time until it reaches the memory limit, at which point Kubernetes restarts the pod.

  • Growth rate is slow but steady (e.g., 250MiB → 1.3GiB over ~4 weeks).
  • No significant drops in memory usage during runtime (even after reconciliations complete).
  • Restarts reset memory to baseline, but the pattern repeats.

Image

On other cluster the source-controller works fine.

Image

Flux system setup is same on both clusters. Could you please help me find the root cause?

Flux version

flux --version: Flux v2.5.1
source-controller image: ghcr.io/fluxcd/source-controller:v1.5.0

flux stats -A on problematic cluster

RECONCILERS             RUNNING FAILING SUSPENDED       STORAGE  
GitRepository           28      1       1               5.0 MiB         
OCIRepository           95      7       0               1.5 MiB         
HelmRepository          10      0       0               12.0 MiB        
HelmChart               11      0       0               1.2 MiB         
Bucket                  0       0       0               -               
Kustomization           343     9       43              -               
HelmRelease             11      0       0               -               
Alert                   538     0       0               -               
Provider                81      0       0               -               
Receiver                18      0       0               -               
ImageUpdateAutomation   0       0       0               -               
ImagePolicy             0       0       0               -               
ImageRepository         0       0       0               -     

flux stats -A on OK cluster

RECONCILERS             RUNNING FAILING SUSPENDED       STORAGE  
GitRepository           28      1       1               5.0 MiB         
OCIRepository           100     8       0               1.5 MiB         
HelmRepository          8       0       0               11.2 MiB        
HelmChart               10      0       0               1.1 MiB         
Bucket                  0       0       0               -               
Kustomization           350     12      40              -               
HelmRelease             10      1       0               -               
Alert                   548     0       0               -               
Provider                90      0       0               -               
Receiver                13      0       0               -               
ImageUpdateAutomation   0       0       0               -               
ImagePolicy             0       0       0               -               
ImageRepository         0       0       0               -  

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions