Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R No Workspace but Allocating 2+GB of Memory?

I have been using R for a while, but this is the first time I have been trying to use it to play with "Big Data." In addition, I am new to Ubuntu.

Currently, there is nothing in my workspace (I am using R Studio), but when I look at the System, the only open R session, generated by R Studio, is allocating over 2 GB of memory on my machine. See the screenshot below.

What am I missing? I typically use rm(), but obviously that is not freeing up the memory. Any help very much appreciated.

enter image description here

like image 848
Btibert3 Avatar asked Nov 01 '25 06:11

Btibert3


1 Answers

I assume you allocated large objects before calling rm. Don't forget to remove any hidden objects (with names that start with ".").

You then need to call gc to actually collect and dispose of all the garbage...

# Remove all objects in the workspace
rm(list=ls(all=TRUE))

# Then collect garbage...
gc()
like image 163
Tommy Avatar answered Nov 03 '25 22:11

Tommy