Hey guys,
I have to load some really big dataframes stored as .rda
files. In doing so, I did notice the following behavior of my Rstudio Server (same behavior on local Rstudio installation).
Whenever I load multiple variables, the memory seems not to be freed after deleting a variable with rm
and calling gc
. Example
load("path_to_2gb.rda")
rm(data)
gc()
load("path_to_4gb.rda")
At this point, the session still allocates over 6gb of RAM. My expectation would be that the memory is 4gb, as the first loaded variable is no longer required.
Is this a known behavior or is there another way to free memory? I really need to load all my data sequentially however I have not enough space to have them all stored in RAM.