Skip to main content
READY FEDROOM DIAGNOSTICS // VIOLET TRIAGE HUD TARGET: SYNAPSE OOM | STATE_GROUPS_STATE | JEMALLOC | CONDUIT RUST
SynapseVsConduit
SynapseVsConduit Partner Notice: Outbound /go/ links marked rel="sponsored" may earn a referral fee at zero checkout surcharge (Disclosures).
Remediation Hub (9)

Enable jemalloc LD_PRELOAD in Synapse Docker & Systemd

Injecting libjemalloc.so.2 cuts post-burst Python Synapse memory retention by 30-45% with zero application code changes.

RSS Reduction: -30% to -45% post-burst | Env: SYNAPSE_USE_JEMALLOC

Enable jemalloc LD_PRELOAD in Synapse Docker & Systemd
Telemetry verified 2026-11-16 by FedRoom Diagnostics.

Step 1: Set LD_PRELOAD or Official Docker Flag

On official matrixdotorg/synapse images, verify whether libjemalloc.so.2 is pre-installed and inject LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2 (or /usr/lib/aarch64-linux-gnu/libjemalloc.so.2 on ARM64) inside docker-compose.yml environment.

Step 2: Tune MALLOC_CONF Background Decay

Pair LD_PRELOAD with MALLOC_CONF="background_thread:true,dirty_decay_ms:5000,muzzy_decay_ms:5000" so freed Python arena pages return to the Linux kernel within five seconds instead of sitting idle.

Measured Thresholds & Configuration

Runtime SetupEnv VariableKernel Page Return
Docker Official Image (x86_64)LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.25s decay with MALLOC_CONF
Debian / Ubuntu Systemd UnitEnvironment="LD_PRELOAD=..."Immediate drop in peak RSS
Continuwuity Rust BinaryBuilt-in Rust allocator / jemallocNative zero-config return
RSS Reduction: -30% to -45% post-burst | Env: SYNAPSE_USE_JEMALLOC Deploy Vultr HF 4 GBHostinger KVM 1 ($4.99/mo)