wordpress   发布时间:2022-04-02  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了R Windows 64bit版本中不支持长矢量但错误大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

概述

我正在尝试测试当前R版本中的内存限制. runtest <- function(sizE) { x <- "testme" while(0<1) { x <- c(x, X) size <<- object.size(X) # size of x when fail } } 通过在我的笔记本电脑上的控制台中运行runtest(大小),我收到以下错误: > runtes
我正在尝试测试当前R版本中的内存限制.

@H_197_21@runtest <- function(sizE) { x <- "testme" while(0<1) { x <- c(x,X) size <<- object.size(X) # size of x when fail } }

通过在我的笔记本电脑上的控制台中运行runtest(大小),我收到以下错误

@H_197_21@> runtest(sizE) Error: cAnnot allocate vector of size 4.0 Gb In addition: Warning messages: 1: In structure(.Call(C_objectSize,X),class = "object_size") : Reached @R_748_10586@l alLOCATIOn of 7915Mb: see Help(memory.sizE) 2: In structure(.Call(C_objectSize,class = "object_size") : Reached @R_748_10586@l alLOCATIOn of 7915Mb: see Help(memory.sizE) 3: In structure(.Call(C_objectSize,class = "object_size") : Reached @R_748_10586@l alLOCATIOn of 7915Mb: see Help(memory.sizE) 4: In structure(.Call(C_objectSize,class = "object_size") : Reached @R_748_10586@l alLOCATIOn of 7915Mb: see Help(memory.sizE) > size 2147483736 bytes >

这个大小看起来非常接近人们之前提到的2 ^ 31-1限制.然后我尝试在我们升级的桌面上运行相同的代码,使用128GB的RAM,并将64位版本的快捷方式中的变量设置为100GB的最大内存使用量.这是我得到的新错误

@H_197_21@Error in structure(.Call(C_objectSize,),class = "object_size"): long vectors not supported yet: unique.c: 1720 > size 8589934680 bytes >

此8.5GB限制是否与在Windows O / S(特别是Windows 7企业版)中运行有关?我认为R帮助文件(http://stat.ethz.ch/R-manual/R-devel/library/base/html/Memory-limits.html)解释了这一点,但我无法理解它的含义(不是我的专业领域).

解决方法

看一下 size.cunique.c的来源,看起来用于改进object.size的哈希不支持长向量:

@H_197_21@/* Use hashing to improve object.size. Here we want equal CHARSXPs,not equal contents. */

@H_197_21@/* Currently the hash table is implemented as a (signed) Integer array. So there are two 31-bit reStrictions,the length of the array and the values. The values are initially NIL (-1). O-based inDices are inserted by isDuplicated,and invalidated by setTing to NA_IntegeR. */

因此,它是一个令人窒息的object.size.如何调用数字(2 ^ 36)来查看是否可以创建这么大的对象(应该是64GB).

大佬总结

以上是大佬教程为你收集整理的R Windows 64bit版本中不支持长矢量但错误全部内容,希望文章能够帮你解决R Windows 64bit版本中不支持长矢量但错误所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。