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
memory r


source to share


No one has answered this question yet

Check out similar questions:

3044
Making a memory leak with Java
2474
How to make a great R reproducible example
1251
How to sort a data frame by multiple columns
879
How do I determine the size of my array in C?
772
How can I find out the memory usage of my application in Android?
672
How do you measure the actual memory usage of an application or process?
587
In Java, what is the best way to determine the size of an object?
537
How do I determine the size of an object in Python?
505
How to determine CPU and memory consumption from within a process?
238
How can I explicitly free memory in Python?



All Articles
Loading...
X
Show
Funny
Dev
Pics