Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rstudio is painfully slow

Tags:

r

rstudio

Suddenly, Rstudio is painfully slow, and now it is unusable. This means, I open it up and there is a lag of several seconds if I type anything. I have explored all the options I can come up with: 1. re-installing both R and Rstudio (although I am not 100% sure I could remove all components), 2. trying to reset settings.... the obvious things such as clearing the workspace and the console.

The size of my data is negligible. I cannot think of anything else.... any ideas?

The only observation i can make that shows something could be wrong with the configuration is (sometimes), I see "gctorture false" as a value in the environment.

like image 621
user8369515 Avatar asked May 29 '18 19:05

user8369515


2 Answers

Just a guess, but ?gctorture says

 Provokes garbage collection on (nearly) every memory allocation.
 Intended to ferret out memory protection bugs.  Also makes R run
 _very_ slowly, unfortunately.

which sounds about right for your problem! You could try

gctorture(FALSE)

If that speeds things up, then look for somewhere that this might have been set, e.g., in a .Rprofile (current working directory, or your user home directory, or the installation directory of R; see ?.Rprofile) and make sure that you start R without loading any .Rhistory or .RData files (again in the working directory, your home directory, etc.)

like image 129
Martin Morgan Avatar answered Nov 15 '22 00:11

Martin Morgan


I had a RStudio project with Git Version Control and then it became very slow. I solved the problem by removing the Git Version Control

like image 45
HappyCoding Avatar answered Nov 15 '22 00:11

HappyCoding