I was editing the above post and 30mins expired. The following is a clearer version of the question:
My project has 20 threads. Each thread logs in with one of my 20 usernames and saves new tweets to username-content.text every hour in an infinite loop.
Now the memory usage is going through the roof, and I am looking for the best solution.
Two questions first:
1.
I use bind to file because I need to use variable (the username) in the file name. It has created a huge memory problem for me because for each user, the file is binded and saved (through list processing) multiple times in a loop.
You said "sync list changes with file" can reduce memory use, but how can I do that in this case? The list setting does not take variable in file name.
2.
Now each thread is binding a different file to that same list name. Will there be any conflicts between threads for that list? i.e one thread is reading the list content which another thread binds to.
Is there a way to make the list have a local copy for each thread, so that each thread operates on different content in the list to avoid this conflict?
If not, then what is the best solution for my goal?
Thanks a lot!