Skip to content
Prev 242700 / 398500 Next

Error: cannot allocate vector of size x Gb (64-bit ... yet again)

On 23.11.2010 09:26, derek eder wrote:
Why? If you have a limit of 4Gb, 4Gb are already used and you try to 
work with a 4Gb objeczt in the matrix function which makes a copy and 
creates another copy (with dim attributed), so 8Gb additionally. You 
will need at least 12 of your 4Gb.  Probably R does not get a sufficient 
amount of non-fragmented memory from the OS or your swap space is not 
"ample".

To make the above more efficient, just use:

dim(x) <- c(10^8/16, 16)

and you won't get any copies.

Uwe