Interesting discussion about the limited RAM in RStudio sessions.
I'm not sure if this helpful but I spent some time wrestling with memory issues in RStudio.cloud.
I spent a good bit of time trying to figure out why my bookdown project hosted on github would work on my local install of RStudio but not RStudio.cloud.
I was getting an error of "Exited with status 9." Some hunting around suggested this is running out of memory but the Pandoc function was declaring the same amount of memory. ( -K512m ) on both the local install and RStudio.cloud. It is a 170 page book. Pandoc seems to finish generating the TeX document of about about 500K but generated the error when before the LaTeX engine generated the PDF.
This morning I closed the tab, opened the project in rstudio.cloud, and it fully worked, generating the PDF.
The repo is OR Using R for anyone that would like to further experiment.