我最近注意到我的 R/RStudio 安装存在问题。当我打开 RStudio 时,事件监视器中的 CPU 使用率显示 rsession 和 kernel_task 进程的使用率徘徊在 30% 左右,即使 R 空闲且未运行任何内容也是如此。我知道这是对问题的非常模糊的描述,我希望这里有人可以指导我如何调试这个问题或发布更多相关信息。
谢谢。
> 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
最佳答案
如果您正在处理特定的 Rstudio 项目,并且该项目有大量文件(数百或数千),Rstudio 可能会尝试对文件建立索引 -
我通过以下方式解决了这个问题:
- 在项目中使用 Rstudio IDE,
- 转到
工具
->项目选项
- 现在点击代码编辑
- 取消选择
索引 R 源文件
- 关闭所有内容并重新启动 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 theFile : Reopen with Encoding
menu command. Source
关于macos - rsession 空闲时CPU使用率,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14599359/