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 ¶
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 ¶
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.
Types ¶
This section is empty.