title: Filestreaming 1 file on webapp under heavy load (Memory Management)
body: <p>I am currently using a single file in my web app to pull tabulation areas (zips, lats, longs, etc) and came across a potential problem while debugging.   </p>
  
  <p>When I rapidly switched between two actions in my web app (both bringing this text file into a filestream) I got the typical "This file is being used by another process" error. I cleaned up my code some more and disposed of said filestreams as quickly as possible and can not reproduce this error anymore.   </p>
  
  <p>That's fine if one user were using the site but if I have potential thousands I see this being a big problem.  </p>
  
  <p>My question is: <strong>How can I make sure this does not happen under a heavy traffic load?</strong>  </p>
  
  <p>I'm spitting out idea's I've had no matter how stupid or impractical they may sound. I have not chosen to go with these ideas for those reasons and that is why I am asking for advice on here.  </p>
  
  <ul>
  <li>Having multiple text files and moving to the next when one is in use</li>
  <li>Creating a copy of the file per request and getting rid of it after its job is done</li>
  <li>Moving the data to a DB</li>
  </ul>
  
  <p>I have tried the DB approach but find that getting all the data into memory takes 3-4 seconds because there is such a large amount of data. A file stream takes less than a second to a second tops.</p>