Diagnosing bottlenecks on your python program

I had an application that required loading some images and performing operations on them. Depending on the size of the images, the memory requirements of the application could make the whole system crash. This needed to be stopped... or at least understood. Looking around, ...