闲置时的rsession CPU使用率 [英] rsession CPU usage when idle

查看:242
本文介绍了闲置时的rsession CPU使用率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近注意到我的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可能正在尝试为这些文件建立索引-

我通过以下方式解决了此问题:

  1. 在项目中时通过Rstudio IDE,
  2. 转到Tools-> Project Options
  3. 现在单击代码编辑
  4. 取消选择Index R Source Files
  5. 关闭所有内容并重新启动Rstudio

编辑

Index R source files-确定是否在 已为项目目录建立索引以进行代码导航(即转到 文件/功能,请转到功能定义).通常这应该保留 已启用,但是如果您的项目目录包含数千个 文件,并担心监视和索引编制的开销 您可以在此处禁用索引.
Insert spaces for tab-确定 tab键是否插入多个空格而不是一个制表符 字符(软标签).配置每个软标签的空格数.
Text encoding-指定源文件的默认文本编码. 请注意,与默认编码不匹配的源文件可以 仍然可以使用File : Reopen with Encoding菜单正确打开 命令. 来源

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:

  1. From the Rstudio IDE while in a project,
  2. Go to Tools -> Project Options
  3. Now click on code editing
  4. deselect Index R Source Files
  5. 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

这篇关于闲置时的rsession CPU使用率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆