I have a question about how R allocates memory/stores large objects. While playing around with memory usage, I made bigger and bigger vectors trying to see what would hit the memory limit on my computer with 8GB of RAM. I couldn't get it to throw an error, so I ran biggie <- rnorm(2e9)
, thinking surely this would blow past the limit. But it didn't break. And now I see a couple strange things in the screenshots below. RStudio is telling me I have a variable of size 16GB. And the memory usage report says that my R objects are using 15.3 GB, while my "session" is only using .2 GB. What magic is R doing that keeps this vector from taking up all my memory?! This is breaking my concept of how R uses memory and what my session memory entails.