Memory Experiment
Privilege |
Description |
FAULT_MEMORY | Allows performing memory experiments |
The Memory experiment consumes a set amount of memory or as much as is available (whichever is lower) and holds onto it for the duration of the experiment. The experiment allocates blocks of memory with malloc until it reaches the desired amount, deallocating the memory with free upon experiment completion.
Options
Parameter | Flag | Required | Default | Version | Description |
---|
MB | -m int | False | | 0.0.1 | The number of megabytes to allocate. |
GB | -g float | False | 0.5 | 0.0.1 | The number of gigabytes to allocate. |
Percentage | -p <0-100> | False | 100 | 2.8.30 | The percentage of total memory to allocate. |
Allocation Strategy | -s absolute | total | False | absolute | 2.24.0 | absolute tells Gremlin to consume the full amount requested, total tells Gremlin to consume only that which brings the system up to the target utilization. |
Length | -l int | False | 60 | 0.0.1 | The length of the experiment (seconds). |
Example
When --allocation-strategy=absolute (the default from the CLI), Memory experiments are additive and are allocated from available memory. For example, if the pre-experiment memory utilization is 500 MB and you initiate a Memory Attack of 500 MB (magnitude), Gremlin will attempt to allocate an additional 500 MB of memory bringing the utilization to approximately 1000 MB (1 GB). Use --allocation-strategy=total to change this behavior. In the prior example, Gremlin will not allocate any memory if the system is already at 500 MB and --allocation-strategy=total.
Troubleshooting
When running a memory experiment on Linux hosts or Kubernetes, the Gremlin process may be terminated by the system's Out of Memory Manager (OOMKiller). Please see this knowledge base article for additional information.