[R-SIG-Mac] memory allocation problems

Sean Davis sdavis2 at mail.nih.gov
Mon Jun 30 12:23:59 CEST 2008


On Sun, Jun 29, 2008 at 6:35 AM, Antonio P. Ramos
<ramos.grad.student at gmail.com> wrote:
> Hi everybody,
>
> I have a memory allocation problem while using  R in my macbook pro,
> which runs the latest leopard. I'm trying to run a monte carlo
> simulation with 500,000 interactions, but the machine failed:
>
>
> Starting MCMC Iterations...
> Error: cannot allocate vector of size 1.2 Gb
> R(176,0xa0640fa0) malloc: *** mmap(size=1239990272) failed (error code=12)
> *** error: can't allocate region
> *** set a breakpoint in malloc_error_break to debug
> R(176,0xa0640fa0) malloc: *** mmap(size=1239990272) failed (error code=12)
> *** error: can't allocate region
> *** set a breakpoint in malloc_error_break to debug
>
>
> Since my machine has 4 Gb of memory, and since I'm not running nothing
> in addition to the simulation, I found it strange. This is my machine:
>
>  Model Identifier:     MacBookPro3,1
>  Processor Name:       Intel Core 2 Duo
>  Processor Speed:      2.4 GHz
>  Memory:       4 GB
>
>
> Unfortunately, I could figure it out how to solve it. Any help?

The error message above means that R failed to allocate a vector of
size 1.2Gb.  That doesn't mean that R was using only 1.2 Gb, but that
it was trying to allocate a new block of memory of that size in
addition to the memory that was already in use.  The system on the Mac
uses a fair amount of memory; R was probably using memory as well.  In
short, you probably need more memory or be more clever about how you
are using the memory you have.  Without more details about what you
are doing, it is difficult to know how to change the latter.

Sean



More information about the R-SIG-Mac mailing list