tags:

views:

77

answers:

2

I'm slightly confused on the following point: I am running R on 32-bit Windows. My understanding is that I should be able to allocate up to 2GB.

I read though help("Memory") and launched my R session with the flag RGui.exe --max-mem-size=1000M. Then confirmed this within R:

> memory.limit()
[1] 1000

But when I run a particular operation, I'm getting an error message which says something like "Cannot allocate object of size 512MB".

Am I doing something wrong?

+2  A: 

Try also adding the flag --max-mem-size=1000M

Note also that on a 32-bit build there may well be enough free memory available, but not a large enough contiguous block of address space into which to map it.

gd047
Sorry @gd047! I actually meant --max-mem-size...
griffin
+3  A: 

Error message don't mean that you have 512MB of available memory. You still have 1000MB limit, but at least 488 is used and for some operation R needs 512MB which isn't available, so it cannot allocate some object.

If you track memory used by R process (e.g. with Process Explorer) then you will see how R reach 1000MB and your message appears.

Marek