Pools contain blocks of memory, which can be allocated as your program needs them. Each block can be in one of three states:
untouched is memory that has not been allocated.
free blocks used to be allocated, but were then freed by CPython because they were no longer needed. When CPython frees memory, it doesn’t get handed back over to the OS. As you can see, it remains owned by CPython, but it’s now marked as
free so it can be used again later. Finally,
allocated blocks were allocated and store some data.
freeblock pointer points to a singly-linked list containing all the free blocks of memory. A linked list is used because these
free blocks may not be contiguous, or near each other. As you can see, these
free blocks are scattered between two different
Become a Member to join the conversation.