> ## 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**](https://praison.ai/docs/sdk/reference/praisonaiagents/modules/protocols.md) module.

AI Agent

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

> [card] [cgroup\_limit\_mb()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/MemoryPressureProtocol-cgroup_limit_mb.md)
>
> Return the container memory limit in MiB, or `None` if unknown.

> [card] [anon\_rss\_mb()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/MemoryPressureProtocol-anon_rss_mb.md)
>
> Return current anonymous (non-reclaimable) RSS in MiB.

## Source

> [card] [View on GitHub](https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/gateway/protocols.py#L4929)
>
> `praisonaiagents/gateway/protocols.py` at line 4929

***

## Related Documentation

> [card] [Memory Concept](https://praison.ai/docs/docs/concepts/memory)

> [card] [Memory Overview](https://praison.ai/docs/docs/memory/overview)

> [card] [Memory Configuration](https://praison.ai/docs/docs/configuration/memory-config)

> [card] [Session Resume](https://praison.ai/docs/docs/memory/session-resume)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.