in reply to Multithreaded memory usage

Try explicitly undefining the variables that hold the thread reference. You might have a circular loop caused by a function captured the thread variable.