3 ms·
I use Jemalloc on a project because it has per-thread allocation counters. This lets me not only track what each thread is using, but also restrict workloads by
by atombender 8d ago
I use Jemalloc on a project because it has per-thread allocation counters. This lets me not only track what each thread is using, but also restrict workloads by enforcing a memory budget. Since my application is almost completely CPU-bound, I allocate one thread per core and then have some smart scheduling to route requests to the threads. I looked at tcmalloc and mimalloc, and neither had this feature at the time, nor did they seem to have any similar feature that could let me have per-thread heaps, which surprised me.