R Decrease memory limit.

I know that you can easily increase the memory limit of R with the command memory.limit (size = N). If I try to reduce it to a value less than N, for obvious reasons, I get an error:

Warning message:
In memory.limit(size = 10) : cannot decrease memory limit: ignored

Is there a way to reduce the memory startup limit before starting (or as the first command)? I want to implement this for training purposes (how to solve memory problems?).

+4
source share
1 answer

From what you use memory.limit, I assume that you are on Windows. If not, see ?'Memory-limits'.

You can start R (from the command line) using the switch --max-mem-size. For instance,

R --max-mem-size=50000000

gives a limit of approximately 50 MB.

+4
source

All Articles