16. Fragmentation
• Fragmentation is when a process’s heap is
inefficiently used.
• The GC may report a low memory
footprint, but the OS reports a much larger
RSS.
22. Hybrid Memory Management
• Use Cython to allocate page-sized blocks of
pointers into incoming chunk
• Hand-off the whole thing to the CPython
memory manager
• Whole thing gets deallocated at once
26. Ratcheting
• Ratcheting is a pathological case of Fragmentation,
caused by the fact that the heap must be contiguous*:
• It’s a limitation of CPython that it cannot compact
memory (mostly due to extensions).
27. Ratcheting
• Ratcheting is a pathological case of Fragmentation,
caused by the fact that the heap must be contiguous*:
• It’s a limitation of CPython that it cannot compact
memory (mostly due to extensions).
28. Ratcheting
• Ratcheting is a pathological case of Fragmentation,
caused by the fact that the heap must be contiguous*:
• It’s a limitation of CPython that it cannot compact
memory (mostly due to extensions).
29. Ratcheting
• Ratcheting is a pathological case of Fragmentation,
caused by the fact that the heap must be contiguous*:
• It’s a limitation of CPython that it cannot compact
memory (mostly due to extensions).
30. Ratcheting
• Avoid persistent objects
• Sockets are common offenders
• Anything that has to be persistent should
be created at application startup, before
processing data
• Avoid letting the heap grow in the first
place