Skip to main content

stress-memory

Generic memory stress action. Allocates memory via the daemon without pod-level cgroup scoping. Targets nodes directly.

Target kind: Node
Implementation: Daemon (ExecStressChaos with stressorType: memory)
Rollback: Yes — sends CancelChaos to terminate stress-ng

Parameters

NameTypeRequiredDefaultDescription
workersstringNo"1"Number of memory stress worker threads
sizestringNo"256m"Memory to allocate per worker (e.g. 256m, 1g)
durationstringNoexperiment durationHow long to run stress

Example

apiVersion: chaos.chaosplane.io/v1alpha1
kind: ChaosExperiment
metadata:
name: stress-memory-example
namespace: chaosplane
spec:
target:
kind: Node
labelSelector:
matchLabels:
node-role.kubernetes.io/worker: ""
action:
type: stress-memory
parameters:
workers: "1"
size: "1g"
duration: "60s"
duration: 60s
rollback:
enabled: true

Rollback behavior

Sends CancelChaos RPC to the daemon, which terminates the stress-ng process and releases the allocated memory.

Implementation notes

This is the generic stress-memory action registered in the executor registry. It runs at the node level, not scoped to a pod's cgroup. All pods on the node compete for the remaining memory. Use pod-memory-stress if you want memory stress scoped to a specific pod's cgroup and subject to its memory limits.