简体   繁体   English

64位R中的“'Calloc'无法分配内存”

[英]"'Calloc 'could not allocate memory" in 64-bit R

I'm on Windows Server 2012 (64-bit) with 30.5 GB of RAM, running R v3.1.2 in RStudio 0.98, and am still having trouble with R hitting a memory limit.我在具有 30.5 GB RAM 的 Windows Server 2012(64 位)上,在 RStudio 0.98 中运行 R v3.1.2,并且仍然遇到 R 达到内存限制的问题。

I reviewed the FAQ here: http://cran.r-project.org/bin/windows/base/rw-FAQ.html#There-seems-to-be-a-limit-on-the-memory-it-uses_0021我在这里查看了常见问题解答:http: //cran.r-project.org/bin/windows/base/rw-FAQ.html#There-seems-to-be-a-limit-on-the-memory-it-用途_0021

Which states that the memory limit on 64-bit instances defaults to the total amount of RAM, and that the limit can be checked and set using memory.limit().其中指出 64 位实例的内存限制默认为 RAM 总量,并且可以使用 memory.limit() 检查和设置限制。

A call to memory.limit() returns 31249 , confirming that it's able to see and use all 30 gigs.memory.limit()的调用返回31249 ,确认它能够查看和使用所有 30 个演出。

However, when I make a modeling call on a large dataset (~10M rows):但是,当我对大型数据集(约 10M 行)进行建模调用时:

ctree(as.formula(formula), data=d, control=ctree_control(mincriterion=0.9, minbucket=1000))

I get the following error:我收到以下错误:

'Calloc' could not allocate memory (18446744073673801728 of 8 bytes) 

But looking at the system task manager I can see that over 25GB is still available, and that R is only using 2.3GB.但是查看系统任务管理器我可以看到仍然有超过 25GB 可用,而 R 只使用了 2.3GB。

Running the modeling outside of RStudio and in R directly yields the same result, so RStudio isn't the variable.在 RStudio 之外和 R 中直接运行建模会产生相同的结果,因此 RStudio 不是变量。

I'm perplexed - why does R refuse to use all my memory?我很困惑 - 为什么 R 拒绝使用我所有的内存?

The problem was a bug in the C code underlying the ctree() function (as correctly suspected by @JoshuaUlrich).问题是ctree()函数底层的 C 代码中的一个错误(正如@JoshuaUlrich 正确怀疑的那样)。 The reason was an integer overflow that has been fixed now in the libcoin package version 1.0-2 that the partykit package builds on.原因是一个整数溢出,现在已经在partykit包构建的libcoin包版本 1.0-2 中修复。

( Comments: We didn't learn about this bug earlier because the party tag was not used for the question here on StackOverflow and the problem was not reported to the package maintainer until today. Thanks to Kris Joanidis who reported the problem and also provided a patch, very much appreciated.) (评论:我们之前没有了解到这个错误,因为在 StackOverflow 上的问题这里没有使用party标签,并且直到今天才向包维护者报告该问题。感谢 Kris Joanidis 报告了问题并提供了一个补丁,非常感谢。)

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

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