Synapse Python OOM When Joining Large Federated Rooms
Joining a single large federated room forces Synapse Python to fetch and resolve thousands of state events in memory, spiking RSS past 2-4 GB.
RSS Spike: +1.4 to +3.2 GB during /join | Threshold: complexity > 1.5
Why State Resolution v2 Triggers Sudden RSS Spikes
When a user joins a federated room with years of power-level and membership history, Synapse downloads the room state graph from remote servers and evaluates State Resolution v2 in Python objects. Each uncompacted event dictionary and cache entry multiplies heap demand before garbage collection runs.
Inspecting Room Complexity and cgroup OOM Events
Check dmesg -T | grep -i oom and query _synapse/admin/v1/rooms/<room_id>/state_status to inspect state_events_count and complexity score. Rooms above complexity 1.5 routinely kill 2 GB VPS instances unless limit_remote_rooms or Continuwuity Rust is deployed.
Measured Thresholds & Configuration
| Room Complexity Score | Synapse Join Peak RSS | Continuwuity / Conduit Rust |
|---|---|---|
| < 0.5 (Team Rooms) | 450 - 750 MB | 95 - 140 MB |
| 1.0 - 1.5 (Medium Public) | 1.4 - 2.3 GB | 150 - 210 MB |
| > 2.5 (Bridged HQ Rooms) | 3.1 - 4.9 GB (OOM on 2-4 GB VPS) | 215 - 290 MB |