“'Calloc'无法分配内存'"在64位R中 [英] "'Calloc 'could not allocate memory" in 64-bit R

查看:945
本文介绍了“'Calloc'无法分配内存'"在64位R中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是Windows Server 2012(64位),具有30.5 GB的RAM,在RStudio 0.98中运行R v3.1.2,但是在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.

我在此处查看了常见问题解答:

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

其中指出在64位实例上的内存限制默认为RAM的总量,并且可以使用memory.limit()检查和设置该限制.

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().

调用memory.limit()会返回31249,确认它能够查看和使用所有30个演出.

A call to memory.limit() returns 31249, confirming that it's able to see and use all 30 gigs.

但是,当我对大型数据集(约1000万行)进行建模调用时:

However, when I make a modeling call on a large dataset (~10M rows):

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

我收到以下错误:

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

但是查看系统任务管理器,我可以看到仍然有超过25GB的可用空间,而R仅使用了2.3GB.

But looking at the system task manager I can see that over 25GB is still available, and that R is only using 2.3GB.

在RStudio外部和R中直接运行建模会产生相同的结果,因此RStudio不是变量.

Running the modeling outside of RStudio and in R directly yields the same result, so RStudio isn't the variable.

我很困惑-为什么R拒绝使用我所有的记忆?

I'm perplexed - why does R refuse to use all my memory?

推荐答案

问题是ctree()函数基础的C代码中的错误(@JoshuaUlrich正确怀疑).原因是整数溢出,现已在partykit软件包所基于的libcoin软件包版本1.0-2中修复.

The problem was a bug in the C code underlying the ctree() function (as correctly suspected by @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.

(评论:我们之前没有了解此错误,因为在StackOverflow上这里没有使用party标记作为问题,并且直到今天才向软件包维护者报告该问题.感谢Kris Joanidis报告了该问题,并提供了补丁,非常感谢.)

(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.)

这篇关于“'Calloc'无法分配内存'"在64位R中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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