错误:protect():Rstudio Server中的保护堆栈溢出

时间:2019-10-11 08:40:49

标签: r rstudio rstudio-server

当我尝试创建一个包含许多virables的环境时遇到错误。

它发生在Ubuntu上的Rstudio Server中,并且可以在macOS上的Rstudio中再现。

以下代码可以复制它。 来自 fast single item lookup from list vs data.table vs hash

# Set seed to 42 to ensure repeatability
set.seed(42)

# Generate product ids
product_ids <- as.vector(
  outer(LETTERS[seq(1, 26, 1)],
        outer(outer(LETTERS[seq(1, 26, 1)], LETTERS[seq(1, 26, 1)], paste, sep=""),
              LETTERS[seq(1, 26, 1)], paste, sep = ""
        ), paste, sep = ""
  )
)

# Create test lookup data
test_lookup_list <- lapply(product_ids, function(id){
  return_list <- list(
    product_id = id,
    val_1 = rnorm(1),
    val_2 = rnorm(1),
    val_3 = rnorm(1),
    val_4 = rnorm(1),
    val_5 = rnorm(1),
    val_6 = rnorm(1),
    val_7 = rnorm(1),
    val_8 = rnorm(1)
  )
  return(return_list)
})

# Set names of items in list
names(test_lookup_list) <- sapply(test_lookup_list, function(elem) elem[['product_id']])

test_lookup_env <- list2env(test_lookup_list)

sessionInfo:

Running under: Debian GNU/Linux 9 (stretch)

Matrix products: default
BLAS/LAPACK: /usr/lib/libopenblasp-r0.2.19.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8   
 [6] LC_MESSAGES=C              LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_3.6.0 tools_3.6.0    packrat_0.5.0 

我已经进行了搜索,并且有很多关于使用参数--max-ppsize=5000000来启动R的建议,但似乎不适用于许多抱怨的帖子,而且我不知道如何为RStudio服务器执行此操作。 如果有任何建议,将非常有帮助。 谢谢。

0 个答案:

没有答案