You are like to run out of memory when keeping all texts in memory. It's better to write them to the file immediately