I\'ve recently become quite fond of Upstart. Previously I\'ve been using God, Monit and Bluepill but I don\'t really like these solutions so I\'m giving Upstart a try.
I
Appending this to the end of myapp-web-*.conf will cause any allocation calls trying to allocate more than 150mb of memory to return ENOMEM:
myapp-web-*.conf
150mb
ENOMEM
limit rss 157286400 157286400
The process might crash at this point, or it might not. That's up to the process!
Here's a test for this in the Upstart Source.