title: Reducing memory.limit() in R to preserve a Remote Desktop Connection
body: <p>How can I limit the amount of working memory R (R x64 3.4.1, via RStudio) has access to while executing a process on a Windows machine?</p>
  
  <p>Normally if I accidentally join two dataframes on the wrong keys, or write too large of a loop, I can easily interrupt the process with CTRL-SHIFT-F10, the stop button, Task Manager etc.</p>
  
  <p>Unfortunately, I'm currently working remotely and this is presenting a problem.</p>
  
  <p>My employer uses Microsoft Remote Desktop Connection to establish an RDP session, and whenever my remote machine's memory utilization gets relatively high (ie. <em>'very high'</em>), the RDP session will drop unexpectedly and I'm unable to remote back in to kill the R process. Presumably, since there is not enough working memory available to establish or maintain the RDP session itself.</p>
  
  <p>As you can imagine, this is a huge bummer. Creating a trouble ticket with IT to physically restart my machine while I sit on the couch at home can take over an hour and, frankly, is getting a little embarrassing.</p>
  
  <p>I've investigated via memory.limit() and it looks like R is set to utilize all ~16000MBs of my machine's available memory. From what I've read here on StackOverflow it isn't possible to reduce the memory limit, only increase it.</p>
  
  <p>Is this true? If so, are there any other options besides being extra careful with memory management and having IT on speed-dial? Does Windows itself maybe provide a solution?</p>