memlimit

package
v0.4.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2026 License: Apache-2.0 Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package memlimit sets the Go runtime's soft memory limit from the container's memory limit, for the operator and the engine.

Index

Constants

View Source
const Env = "MEMORY_LIMIT"

Env has the container's memory limit in bytes: the chart (operator) and the injected engine set it from the downward API (resourceFieldRef limits.memory). Without a limit, Kubernetes gives the node's allocatable memory.

Variables

This section is empty.

Functions

func Limit

func Limit(getenv func(string) string) int64

Limit returns the Go runtime's soft memory limit: 90% of the container's memory limit, the rest left for what the runtime doesn't manage. 0 when GOMEMLIMIT is set (the runtime applied it) or no limit is known.

The heap goal is otherwise twice the live heap at the last GC, so the RSS of a busy process reaches the container limit long before its live heap does (0004 §8). With a limit, the GC runs more often near it.

func Set

func Set(getenv func(string) string) int64

Set applies Limit, if any, and returns it.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL