Where I work we have a script running in production that is very key to the operation of one of our products. Many moons ago an issue was discovered with it that caused it to grow in memory (and I am not privy to what that was) until it eventually SIGSEG-ed and died. The solution that was put in place was the script inspected itself for how much memory it had consumed and when it went beyond a certain limit it spawned and died.