Okay. Thanks for the insight. Planning to do this:
You need to monitor which process is using all the memory. The easiest way is probably to keep htop running in a screen or tmux session, periodically connect, and look at which processes have the highest used memory.
Will report back with findings when it crashes again. Thanks for all the help.