Skip to content
Prev 306916 / 398506 Next

How to limit memory on a server

On 04/10/2012 10:07, Hervy Cyril wrote:
You are still confused.  No, memory.limit() refers to virtual memory, 
and a process on a tolerably recent OS does not even know if VM is 
mapped or not without using OS-specific system calls (which R does not).

?memory.limit talks about 'obtainable memory', not RAM.

Because Windows manages VM poorly, R for Windows is set up to try to 
keep its VM usage less than an amount that is likely to be mapped at 
once.  But you can alter that, and with a fast SSD it may be worthwhile 
to do so.

It is not even true that 'R keeps all the data in' *memory*: that's the 
point of lazy-loading.  R objects in packages (including most of R 
itself) are kept on disc databases until actually used.