Extend memory size limit in R

后端 未结 4 784
有刺的猬
有刺的猬 2020-12-18 13:55

I have a R program that combines 10 files each file is of size 296MB and I have increased the memory size to 8GB (Size of RAM)

--max-mem-size=8192M
         


        
4条回答
  •  清酒与你
    2020-12-18 14:19

    Memory allocation needs contiguous blocks. The size taken by the file on disk may not be a good index of how large the object is when loaded into R. Can you look at one of these S files with the function:

    ?object.size
    

    Here is a function I use to see what is taking up the most space in R:

    getsizes <- function() {z <- sapply(ls(envir=globalenv()), 
                                    function(x) object.size(get(x)))
                   (tmp <- as.matrix(rev(sort(z))[1:10]))}
    

提交回复
热议问题