Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set memory limit in RStudio (desktop version)?

Tags:

I'm aware that there has already been a similar question here, but the answer is out-of-date. The information I've found in the internet refers to RStudio Server rather than Desktop.

I have limited resources on my Windows 7 x64 PC. I've set the environment variable R_MAX_MEM_SIZE and this is accepted by the RGui (as seen when typing memory_limit()). However, RStudio (Version 0.98.507) ignores this setting and still uses the entire memory of my computer which sometimes leads to crashes of the whole system. How can I limit the amount of memory used by R when running it in RStudio Desktop?

like image 763
AnjaM Avatar asked May 30 '14 08:05

AnjaM


People also ask

How do I check memory limit in RStudio?

1600, the RStudio IDE includes a small memory usage widget in the Environment pane. This widget helps you track the amount of memory your R session is using. The pie chart shows the total system memory usage; that is, if your system has 8GB of RAM and 4GB is currently in use, it will show at 50%.

Does R have a memory limit?

Under most 64-bit versions of Windows the limit for a 32-bit build of R is 4Gb: for the oldest ones it is 2Gb. The limit for a 64-bit build of R (imposed by the OS) is 8Tb.

How much memory does RStudio use?

RStudio Connect's hardware specifications will depend on the number and type of applications, documents, and analysis running on the server. Standard specifications for a production server might range from 8-16 cores and 32-128 GB of RAM.

What is the memory limit in R for 64-bit system?

For a 64-bit versions of R under 64-bit Windows the limit is currently 8Tb. Memory limits can only be increased.


1 Answers

This works for my PC :

 # Check memory limit    memory.limit()  # Change memory limit    memory.limit(size = 15000) 
like image 173
adjustedR2 Avatar answered Oct 10 '22 03:10

adjustedR2