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

# Memory Pressure Protocol • AI Agent SDK

> MemoryPressureProtocol: Protocol for reading the memory budget and pressure of a gateway host.

# MemoryPressureProtocol

> Defined in the [**protocols**](../modules/protocols) module.

<Badge color="blue">AI Agent</Badge>

Protocol for reading the memory budget and pressure of a gateway host.

Pure contract the gateway implements over its own process: report the
container's memory limit (from the cgroup v1/v2 memory limit) and the
current anonymous (non-reclaimable) RSS, so the eviction budget tracks the
*real* container ceiling rather than a hard-coded number. Both return
`None`/`0` gracefully when the platform can't report them, so the
planner degrades to a no-op instead of crashing the gateway it protects.

## Methods

<CardGroup cols={2}>
  <Card title="cgroup_limit_mb()" icon="function" href="../functions/MemoryPressureProtocol-cgroup_limit_mb">
    Return the container memory limit in MiB, or `None` if unknown.
  </Card>

  <Card title="anon_rss_mb()" icon="function" href="../functions/MemoryPressureProtocol-anon_rss_mb">
    Return current anonymous (non-reclaimable) RSS in MiB.
  </Card>
</CardGroup>

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/gateway/protocols.py#L3503">
  `praisonaiagents/gateway/protocols.py` at line 3503
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Memory Concept" icon="brain" href="/docs/docs/concepts/memory" />

  <Card title="Memory Overview" icon="database" href="/docs/docs/memory/overview" />

  <Card title="Memory Configuration" icon="gear" href="/docs/docs/configuration/memory-config" />

  <Card title="Session Resume" icon="rotate-right" href="/docs/docs/memory/session-resume" />
</CardGroup>
