Several housekeeping operations in jemalloc are currently piggybacked on normal allocation/deallocation requests, because there is no way to asynchronously perform work. Although jemalloc must continue to support this mode of operation by default (it's unacceptable to create threads behind the application's back), large long-lived server applications could greatly benefit from jemalloc managing per arena background asynchronous worker threads. Main application threads could hand off various work, including:
- Purge unused dirty pages.
- Batch-deallocate regions flushed from tcaches or acaches.
- Pre-fill acaches.