How to clean up R memory (without the need to restart my PC)?

后端 未结 8 918
小蘑菇
小蘑菇 2020-12-07 14:37

I am running my code in R (under Windows) which involves a lot of in-memory data. I tried to use rm(list=ls()) to clean up memory, but seems the memory is still

相关标签:
8条回答
  • 2020-12-07 15:29

    Maybe you can try to use the function gc(). A call of gc() causes a garbage collection to take place. It can be useful to call gc() after a large object has been removed, as this may prompt R to return memory to the operating system. gc() also return a summary of the occupy memory.

    0 讨论(0)
  • 2020-12-07 15:30

    Use ls() function to see what R objects are occupying space. use rm("objectName") to clear the objects from R memory that is no longer required. See this too.

    0 讨论(0)
提交回复
热议问题