]>
git.ipfire.org Git - thirdparty/rspamd.git/commit
[Feature] Use specialized pool types for long-lived and short-lived allocations
Replace generic rspamd_mempool_new calls with specialized variants
to optimize allocation strategies based on pool lifetime.
Long-lived pools (RSPAMD_MEMPOOL_LONG_LIVED):
- server_pool (main server context, rspamadm)
- cfg_pool (configuration, 8MB)
- Module contexts (fuzzy_check, fuzzy_backend)
- Upstream context
- Radix trees
- Maps (hash, radix, regexp - 5 instances)
- Static Lua pools (url, regexp)
Short-lived pools (RSPAMD_MEMPOOL_SHORT_LIVED):
- HTTP/controller sessions
- Task pools (message processing)
- Milter sessions
- Proxy sessions (2 instances)
- Lua parsers (HTML, email - 2 instances)
- Lua mempool creation
- Lua worker control
Benefits:
- Long-lived pools: larger initial page size, fewer reallocations
- Short-lived pools: smaller initial size, faster allocation/deallocation
- Better memory efficiency based on usage patterns
17 files changed: