Skip to content
Prev 316815 / 398506 Next

Rprof causing R to crash

Could you be a little more explicit of what the error message is.  On
my Windows system 32-bit, I get the following:
Error: cannot allocate vector of size 381.5 Mb

Which is probably due to trying to allocate 1e8 elements of integers
(400MB).  Could you have a similar problem?

Now you could restructure your code to not allocate the large vector by:

Rprof()
z <- 1
i <- 0
system.time(while((i <- i + 1) < 1e8) z <- z + 1/i)
z
Rprof(NULL)
On Mon, Feb 4, 2013 at 7:48 AM, c97sr <sr at stevenriley.net> wrote: