I have recently noticed an issue with my R / RStudio installation. When I have RStudio opened, the CPU usage in activity monitor shows the rsession and kernel_task processes hovering around 30% usage even when R is idle and not running anything. I know this is a very vague description of the issue, I'm hoping someone here can give me pointers how to debug this issue or post more relevant information.
Thank you.
> sessionInfo()
R version 2.15.2 (2012-10-26)
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
locale:
[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] tools_2.15.2
If you are working in a specific Rstudio project, and this project has lots of files (hundreds or thousands) Rstudio may be trying to index the files -
I fixed this by:
- From the Rstudio IDE while in a project,
- Go to
Tools
-> Project Options
- Now click on code editing
- deselect
Index R Source Files
- close everything and restart Rstudio
Editing
Index R source files
— Determines whether R source files within the
project directory are indexed for code navigation (i.e. go to
file/function, go to function definition). Normally this should remain
enabled, however if you have a project directory with thousands of
files and are concerned about the overhead of monitoring and indexing
them you can disable indexing here.
Insert spaces for tab
— Determine
whether the tab key inserts multiple spaces rather than a tab
character (soft tabs). Configure the number of spaces per soft-tab.
Text encoding
— Specify the default text encoding for source files.
Note that source files which don't match the default encoding can
still be opened correctly using the File : Reopen with Encoding
menu
command. Source