![cover](https://img-blog.csdnimg.cn/78944f17f3604230809ad1dc95598acb.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBARGF0YStTY2llbmNlK0luc2lnaHQ=,size_8,color_FFFFFF,t_70,g_se,x_16)
Error: cannot allocate vector of size XX Gb
·
Error: cannot allocate vector of size XX Gb
目录
Error: cannot allocate vector of size XX Gb
#问题
x <- rnorm(4000000000)
# Trying to run rnorm function
# Error: cannot allocate vector of size 29.8 Gb
#解决
#垃圾回收;
gc()
#空间依旧不够
x <- rnorm(4000000000)
# Trying to run rnorm function
# Error: cannot allocate vector of size 29.8 Gb
#增大内存
#查看分配的内存大小
memory.limit()
# Check currently set limit
# [1] 16267
#增大分配的内存
memory.limit(size = 35000)
# Increase limit
# [1] 35000
x <- rnorm(4000000000)
# Successfully running rnorm function
参考:R
参考:R Error: Cannot Allocate Vector of Size N GB (2 Examples) | How to Increase the Memory Limit
更多推荐
所有评论(0)