I have a fairly involved script that handles some build management tasks, which can run for as long as several hours. I've recently seen it fail primarily due to failures to fork due to insufficient memory. I took a look and saw the bash process consuming as much as 3+ GB of memory. I'm not doing anything where I'd expect to be consuming that much memory.
Does anyone have suggestions on ways to debug the use of memory, so I can identify and hopefully eliminate the offending code? Due to the complexity and lengthy runtime of the script, it's unlike I'll be able to boil it down to a trivial case. Thanks, Bob