2 ms·
> use sophisticated strategies to reduce allocation calls and memory fragmentation Both of these are things a high quality allocator (jemalloc in this case) ha
by CodesInChaos 5y ago
> use sophisticated strategies to reduce allocation calls and memory fragmentation
Both of these are things a high quality allocator (jemalloc in this case) has to to optimize for as well (in this context "allocation calls" corresponds to syscalls). For example they also allocate different sizes from different buckets.
Applications do have some abilities an allocator does not have, for example:
* It can move allocations, since it can invalidate pointers. This allows defragmentation/compaction to happen
* It can try to predict how long lived an allocation will be
But it's not clear to me if any of these are important for performance.