Arenas are at the highest level of abstraction, and they contain pools. However, they don’t have explicit states in the way that pools and blocks do. Arenas are instead organized into a doubly-linked list called
00:18 This is like the starting point of CPython’s journey to find some available memory. This doubly-linked list allows the allocation algorithm to see which arena has the least amount of overall free space.
01:01 This is why the allocation algorithm prioritizes allocating free blocks over unused ones. The whole idea is to try to use memory that’s already been used, in an attempt to increase the likelihood of one of these mostly free arenas eventually containing all free pools.
Become a Member to join the conversation.