简体   繁体   English

R系统长呼叫挂起

[英]Long R system call hangs

I would greatly appreciate some help with the following: 在以下方面,我将不胜感激:

I am simply running 3 instances of a standalone app from R in foreach in parallel. 我只是在foreach中并行运行R中一个独立应用程序的3个实例。 Please see the mock code below: 请参见下面的模拟代码:

require("foreach")
require("doMC")

registerDoMC(cores=3)
foreach(sample=1:9) %dopar%{
        system2(command="app", args=c("some","args"), 
                stdout = NULL, stderr = NULL) 
}

Regardless of whether I use system , system2 , in the task manager I can see: 无论我是否在任务管理器中使用systemsystem2 ,我都可以看到:

  1. rsession (parent) 会话(父级)
  2. 3x rsessions (from foreach) 3次会话(来自foreach)
  3. 3x app (processes) 3x应用程序(进程)

The problem is: parent uses a lot of CPU and keeps consuming RAM until I fall into swap. 问题是:在我掉入交换之前, 父母使用了大量CPU并不断消耗RAM。 This happens for any app , any number of threads in foreach and essentially, any system call from R, which runs longer than some negligible times hangs and never returns. 对于任何appforeach的线程数量以及本质上来说,来自R的任何系统调用都会发生这种情况,该过程的运行时间比某些可忽略的时间挂起并且永远不会返回。

My machine has Debian Jessie and R 3.2.3. 我的机器上有Debian Jessie和R 3.2.3。

Thank you in advance! 先感谢您!

Ok, I have found what was causing the problem: RStudio. 好的,我发现了引起问题的原因:RStudio。 The rsession parent thing was likely scanning for file changes and stalling somewhere until the process finishes. rsession父对象可能会扫描文件更改并停滞在某处,直到该过程完成。 Running R from console displays no such problem. 从控制台运行R不会显示此类问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM