R memory management / cannot allocate vector of size n Mb

后端 未结 8 1983
攒了一身酷
攒了一身酷 2020-11-21 07:18

I am running into issues trying to use large objects in R. For example:

> memory.limit(4000)
> a = matrix(NA, 1500000, 60)
> a = matrix(NA, 2500000,         


        
8条回答
  •  甜味超标
    2020-11-21 08:21

    The save/load method mentioned above works for me. I am not sure how/if gc() defrags the memory but this seems to work.

    # defrag memory 
    save.image(file="temp.RData")
    rm(list=ls())
    load(file="temp.RData")
    

提交回复
热议问题