R Decrease memory limit
Asked Answered
G

1

6

I know it's easily possible to increase the memory limit of R using the command memory.limit(size=N). If I try to decrease it to a value smaller than N, for obvious reasons I get the error:

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

Is there a way to decrease the memory limit upfront running code (or as first command)? I want to implement this for training purposes (how to deal with memory issues?).

Greenlet answered 17/6, 2016 at 11:13 Comment(0)
S
6

From the fact that you are using memory.limit I assume that you are under Windows. If not, see ?'Memory-limits'.

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

R --max-mem-size=50000000

gives a limit of approximately 50MB.

Scotia answered 17/6, 2016 at 11:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.