> ## 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 Policy • AI Agent SDK

> MemoryPressurePolicy: Config-driven RSS-threshold resource-pressure policy.

# MemoryPressurePolicy

> Defined in the [**protocols**](https://praison.ai/docs/sdk/reference/praisonaiagents/modules/protocols.md) module.

AI Agent

Config-driven RSS-threshold resource-pressure policy.

The default wired by the `max_rss_mb` gateway config key
(`BotOS(max_rss_mb=...)` / `gateway.yaml`) and the
`AdmissionGate(resource_policy=...)` Python surface. It is intentionally
minimal and dependency-free so the decision lives in core and is provable
in isolation; the wrapper owns the live sampler and the side effects
(queue / shed / busy ack).

The decision, given a sample's `rss_mb`:

* `ADMIT` while `rss_mb &lt; soft_rss_mb` (or the platform can't report
  memory, so `rss_mb is None` — never block on a missing signal).
* `QUEUE` (apply backpressure) while `soft_rss_mb &lt;= rss_mb &lt;
  hard_rss_mb`.
* `REJECT` (shed with a busy ack) while `rss_mb &gt;= hard_rss_mb`.

A `hard_rss_mb` of `0` disables pressure-based shedding entirely
(every sample admits) — the legacy default when no threshold is set.

Example::

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
MemoryPressurePolicy(soft_rss_mb=400, hard_rss_mb=550)
```

## Constructor

**soft\_rss\_mb** `float` (default: 0.0)

No description available.

**hard\_rss\_mb** `float` (default: 0.0)

No description available.

## Methods

> [card] [enabled()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/MemoryPressurePolicy-enabled.md)
>
> Whether pressure-based admission is active (a threshold is set).

> [card] [evaluate()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/MemoryPressurePolicy-evaluate.md)
>
> Instance method.

## Source

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

***

## 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.