Skip to content

Provide refresh interval config for GOMEMLIMIT to support dynamic memory limits #18712

@hisarbalik

Description

@hisarbalik

Proposal

The Automatically set GOMEMLIMIT to match Linux container or system memory limit functionality currently initializes GOMEMLIMIT only once at startup by invoking memlimit.SetGoMemLimitWithOpts with memlimit.WithRatio as the sole option. Consequently, if the container’s cgroup memory limit changes during runtime, for example, when a Vertical Pod Autoscaler (VPA) updates resource limits, the Go runtime’s GOMEMLIMIT remains unchanged and continues to reflect the value determined at startup.

The underlying automemlimit library already supports periodically refreshing the memory limit via WithRefreshInterval, which could be used to ensure GOMEMLIMIT stays synchronized with runtime cgroup memory limit changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions