How to free memory after deleting an object

I am contacting you directly as I cannot find a solution on my own. I am uploading a huge one shapePoly

using a function readShapePoly

. I do some processing on them and substitution in order to work on substances and not with the whole ShapePolyDataFrame

. My problem is that I cannot free memory on R.

For example, suppose I have a public shapePoly

:

tmp <- readShapePoly("C:/…/clc06_c112.shp", verbose=TRUE, repair=FALSE)

      

then i try to erase the variable tmp

: ds ()

           *used  (Mb) gc trigger  (Mb)  max used (Mb)
Ncells  5314951 142.0   15726413 420.0  19658017  525
Vcells 26412646 201.6  101851119 777.1 117429418  896*


rm(tmp)
gc()
         used (Mb) gc trigger  (Mb)  max used (Mb)
Ncells 482945 12.9   12581130 336.0  19658017  525
Vcells 588952  4.5   81480895 621.7 117429418  896

      

While it seems to affect R, it doesn't affect memory when tracking it on a Windows system. I think the variable tmp

can be a pointer, but I cannot solve it.

+3


source to share





All Articles