To reproduce an issue where a node in a Kubernetes cluster got terminated due to an application using all available memory.
while(true) malloc(1MB)
, pretty much.
Try not to run this locally. Use the docker image inside docker to test it out.
docker run --rm \
-e DELAY=5 \
-e STRATEGY=burn \
-e CHUNK_MEGABYTE_SIZE=1000 \
ghcr.io/oslokommune/memory-burner:v0.0.6
Memory burner is configured using environment variables. The following configuration parameters are available:
determines how many seconds from execution to the actual memory burn begins. Default is 1 second.
Determines if the app should just hold on to the memory, i.e.: hold
, or if it
should try to burn as much memory as possible, i.e.: burn
.
Determines how many megabytes of memory it should hold on to in the hold
strategy. Or how many megabytes of memory it should burn each CPU cycle for the
burn
strategy.