Skip to content

Replace locked mempools with memory contexts

Ondřej Surý requested to merge 2398-reduce-memory-used-by-mempools-v9_16 into v9_16

Current mempools are kind of hybrid structures - they serve two purposes:

  1. mempool with a lock is basically static sized allocator with pre-allocated free items

  2. mempool without a lock is a doubly-linked list of preallocated items

The first kind of usage could be easily replaced with jemalloc small sized arena objects and thread-local caches.

The second usage not-so-much and we need to keep this (in libdns:message.c) for performance reasons.

Closes #2398 (closed)

Edited by Ondřej Surý

Merge request reports