Start your 30 day free trial.
START FOR FREE

Memory Experiment

Supported platforms:

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, then deallocates the memory with free upon experiment completion.

Options

ParameterFlagRequiredDefaultVersionDescription
MB-m intFalse0.0.1The number of megabytes to allocate.
GB-g floatFalse0.50.0.1The number of gigabytes to allocate.
Percentage-p <0-100>False1002.8.30The percentage of total memory to allocate.
Allocation Strategy-s absolute | totalFalseabsolute2.24.0absolute 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 intFalse600.0.1The length of the experiment (seconds).

Allocation strategy

The memory experiment supports two different methods of allocating memory:

  • Absolute tells Gremlin to consume the full amount requested.
  • Total tells Gremlin to only consume the amount of memory necessary to bring total usage up to the target amount.

When the strategy is set to absolute (the default), Gremlin allocates the full amount of memory that you request. For example, if the pre-experiment memory utilization is 2 GB and you initiate a memory experiment of 3 GB, Gremlin will attempt to allocate an additional 3 GB, bringing the system’s total memory utilization up to 5 GB.

When the strategy is set to total, Gremlin will calculate the difference between the current utilization and the target utilization, then attempt to allocate that amount. In this case, Gremlin will allocate an additional 1 GB (3 GB - 2 GB) to bring the system’s total memory utilization up to 3 GB. If the system is already utilizing more memory than the amount requested (e.g., you request 3 GB and the system is utilizing 4 GB), the experiment will do nothing until memory utilization drops below the amount requested.

Percentage vs. numerical allocation

When telling Gremlin how much memory to consume, you can specify a percentage or a total amount in MB or GB. When using percentage allocation, Gremlin will calculate the amount of memory to consume based on the target’s current memory utilization.

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.

Required privileges

On this page
Back to top