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
Just adding this for reference in case anybody needs to restart and immediatly run a command.
I'm using this approach just to clear RAM from the system. Make sure you have deleted all objects no longer required. Maybe gc()
can also help before hand. But nothing will clear RAM better as restarting the R session.
library(rstudioapi)
restartSession(command = "print('x')")