Skip to Content

Loading/Reading data in R taking up too much memory

I am using R for some data analysis. System specs: i5 + 4GB RAM.
For some reason, my R session is taking up a chunk of my RAM much much bigger than my data which leaves me with very little space for other operations.

I read a 550MB csv file, memory taken by R: 1.3 - 1.5GB
I saved the csv as a .RData file. File size: 183MB. Loaded the file in R, memory taken by R: 780MB.
Any idea why this could be happening and how to fix it?

The file has 123 columns and 1190387 rows. The variables are of type num and int.