Dying, fast and slow: out-of-memory crashes in Python
A segfaulting program might be the symptom of a bug in C code–or it might be that your process is running out of memory.
Crashing is just one symptom of running out of memory.
Your process might instead just run very slowly, your computer or VM might freeze, or your process might get silently killed.
Sometimes if you’re lucky you might even get a nice traceback, but then again, you might not.
So how do you identify out-of-memory problems?
With some understanding of how memory works in your operating system and in Python, you can learn to identify all the different ways out-of-memory problems can manifest:
- A slow death.
- An obvious death.
- A corrupted death.
- Death by assassination.
A slow death: Swapping
When your computer’s RAM fills