Skip to content

Commit f44a88d

Browse files
authored
Improve chunk picking for the large-size buddy allocator (#16179)
Motivation: The metric of how efficiently the adaptive allocator is able to reuse existing chunks, is critical for reducing memory usage for a given allocation workload. The size-classed chunks are very forgiving because any available segment will work. The buddy allocator is less forgiving, as it can experience fragmentation, and thus we need to be smarter than a simple FIFO queue when picking chunks for buddy allocated magazines. Modification: - Implement a ConcurrentSkipListIntObjMultimap, based on the public-domain ConcurrentSkipListHashMap from Doug Lea. - Use this new data structure to organize and pick chunks that are most likely to have space for a requested allocation. - Add a ChunkCache abstraction to the adaptive allocator, which is implemented using either a concurrent queue or the skip-list, for the size-classed and the buddy chunks respectively. - Remove the 32k and 64k size classes. Result: We have reduced memory usage from better chunk reuse.
1 parent 6481c99 commit f44a88d

4 files changed

Lines changed: 2309 additions & 216 deletions

File tree

0 commit comments

Comments
 (0)