Data output for the file write was put into a thread.  The write out of data was causing a memory issue unless it was written out as the data came in.