> ## Documentation Index
> Fetch the complete documentation index at: https://docs.siderolabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

> OOMConfig is a Out of Memory handler config document.

# OOMConfig

```yaml theme={null}
apiVersion: v1alpha1
kind: OOMConfig
triggerExpression: |- # This expression defines when to trigger OOM action.
    multiply_qos_vectors(d_qos_memory_full_total, {System: 8.0, Podruntime: 4.0}) > 3000.0 &&
    multiply_qos_vectors(qos_memory_full_avg10, {System: 1.0, Podruntime: 1.0}) > 5.0 ||
    memory_full_avg10 > 75.0 && time_since_trigger > duration("10s")
cgroupRankingExpression: 'memory_max.hasValue() ? 0.0 : ({Besteffort: 1.0, Burstable: 0.5, Guaranteed: 0.0, Podruntime: 0.0, System: 0.0}[class] * double(memory_current.orValue(0u)))' # This expression defines how to rank cgroups for OOM handler.
sampleInterval: 100ms # How often should the trigger expression be evaluated.
```

<table>
  <thead>
    <tr>
      <th>Field</th>
      <th>Type</th>
      <th>Description</th>
      <th>Value(s)</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>`triggerExpression`</td>
      <td>Expression</td>
      <td>This expression defines when to trigger OOM action.<br /><br />The expression must evaluate to a boolean value.<br />If the expression returns true, then OOM ranking and killing will be handled.<br /><br />This expression receives the following parameters:<br />- `memory_{some,full}_{avg10,avg60,avg300,total}` - double, representing PSI values<br />- time\_since\_trigger - duration since the last OOM handler trigger event</td>

      <td />
    </tr>

    <tr>
      <td>`cgroupRankingExpression`</td>
      <td>Expression</td>
      <td>This expression defines how to rank cgroups for OOM handler.<br /><br />The cgroup with the highest rank (score) will be evicted first.<br />The expression must evaluate to a double value.<br /><br />This expression receives the following parameters:<br />- memory\_max - Optional{"<"}uint{">"} - in bytes<br />- memory\_current - Optional{"<"}uint{">"} - in bytes<br />- memory\_peak - Optional{"<"}uint{">"} - in bytes<br />- path - string, path to the cgroup<br />- class - int. This represents cgroup QoS class, and matches one of the constants, which are also provided: Besteffort, Burstable, Guaranteed, Podruntime, System</td>

      <td />
    </tr>

    <tr>
      <td>`sampleInterval`</td>
      <td>Duration</td>
      <td>How often should the trigger expression be evaluated.<br /><br />This interval determines how often should the OOM controller<br />check for the OOM condition using the provided expression.<br />Adjusting it can help tune the reactivity of the OOM handler.</td>

      <td />
    </tr>
  </tbody>
</table>
