2. Background
Memory was found to be leaking somewhere in our Python scripts
There are a bunch of tools I had never used before to find and diagnose the problem
3. Good Ol’ Top (or htop)
Run your code and watch resident memory increase
● top -> shift+F -> n -> enter
● top -> shift+M
● watch -n 1 ps -o rss -C PROCESSNAME
● watch -n 1 ps -o rss -p PID
9. Linux Memory System Calls
brk - set the program break, adds memory pages to the top of the heap
sbrk - increments the program break
mmap - map independent page of memory
munmap - unmaps memory pages
strace -e brk,mmap,munmap -p $(pidof PROCNAME)
Compiler flag -O0 removes optimizations