title: Error Message: RStudio R Session has stopped working
body: <p>I found questions with similar title but not the same question (<a href="https://support.rstudio.com/hc/communities/public/questions/200671597--Rstudio-exe-has-stopped-working-stuck-in-an-infinite-loop-of-crashing?locale=en-us" rel="nofollow">https://support.rstudio.com/hc/communities/public/questions/200671597--Rstudio-exe-has-stopped-working-stuck-in-an-infinite-loop-of-crashing?locale=en-us</a>). I am getting the error message when I am actually running a script. The script includes few packages(data.table, rJava, XLConnect, chron, R.utils) and couple of functions. The purpose of the script is to read through about 2.3 million records in chunks of 50000 lines using "fread", do manipulations/calculations and write out. In the first attempt the script worked and went through the entire file and did not give any error except while reaching the end of the last chunk as it was attempting to read 50000 lines but found 37000 lines. It took around 7 minutes to run through the script. Since that attempt, the R-studio session keeps on crashing at different iterations in the for loop, generally between 13th and 33rd iteration of the for loop (In all there are 46 iterations). Below is a portion of the log file. What's weird is that the log file indicates different errors at different times. I'd really appreciate some help in this regard.</p>
  
  <p>LOG FILE EXERPTS:
  /* 
      17 Jan 2014 20:10:59 [rsession-bguha] ERROR system error 32 (The process cannot access the file because it is being used by another process) [path=C:/hiberfil.sys]; OCCURRED AT: time_t core::FilePath::lastWriteTime() const C:\Users\Administrator\rstudio\src\cpp\core\FilePath.cpp:534; LOGGED FROM: time_t core::FilePath::lastWriteTime() const C:\Users\Administrator\rstudio\src\cpp\core\FilePath.cpp:534
       17 Jan 2014 20:10:59 [rsession-bguha] ERROR system error 32 (The process cannot access the file because it is being used by another process) [path=C:/pagefile.sys]; OCCURRED AT: uintmax_t core::FilePath::size() const C:\Users\Administrator\rstudio\src\cpp\core\FilePath.cpp:340; LOGGED FROM: uintmax_t core::FilePath::size() const C:\Users\Administrator\rstudio\src\cpp\core\FilePath.cpp:340</p>
  
  <pre><code>17 Jan 2014 19:47:09 [rsession-bguha] CLIENT EXCEPTION (rsession-bguha): (TypeError) ||| line: 7394||| sourceId: 112341176||| sourceURL: http://127.0.0.1:28933/rstudio/7ABF72ED105B7067B7EBBE5434F51E55.cache.html: 'null' is not an object (evaluating 'this.b.e.Am');|||Client-ID: 33e600bb-c1b1-46bf-b562-ab5cba070b0e|||User-Agent: Mozilla/5.0 (Windows NT 6.1 WOW64) AppleWebKit/534.34 (KHTML, like Gecko) Qt/4.8.3 Safari/534.34 Qt/4.8.3
  
  17 Jan 2014 19:35:07 [rsession-bguha] ERROR system error 2 (The system cannot find the file specified); OCCURRED AT: core::Error session::modules::git::::discoverGitBinDir(core::FilePath*) C:\Users\Administrator\rstudio\src\cpp\session\modules\SessionGit.cpp:2269; LOGGED FROM: void session::modules::git::onUserSettingsChanged() C:\Users\Administrator\rstudio\src\cpp\session\modules\SessionGit.cpp:2493
  
  17 Jan 2014 20:10:59 [rsession-bguha] ERROR system error 32 (The process cannot access the file because it is being used by another process) [path=C:/pagefile.sys]; OCCURRED AT: time_t core::FilePath::lastWriteTime() const :\Users\Administrator\rstudio\src\cpp\core\FilePath.cpp:534; LOGGED FROM: time_t core::FilePath::lastWriteTime() const C:\Users\Administrator\rstudio\src\cpp\core\FilePath.cpp:534; */
  </code></pre>