[R] Error cannot allocate vector of size...

Rod villegas.ro at gmail.com
Fri Jan 11 11:44:49 CET 2008


On Jan 8, 2008 3:40 PM, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
>
> On 1/8/2008 8:49 AM, Rod wrote:
> > On Jan 8, 2008 12:41 PM, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
> >>
> >> Rod wrote:
> >> > Hello,
> >> >
> >> > I have a memory problem when I run package WinBUGS with R (2.6.1).
> >> > Until now I have been using a Pentium IV 3.2Ghz computer with 512Mb of
> >> > RAM memory (with Windows XP Pro SP2), and I hadn't had any problem.
> >> > Now I have a new computer with the following characteristics: Intel
> >> > Core 2 duo 2.33Ghz and 3Gb of RAM memory (with Windows XP Pro SP2) and
> >> > when I am running the same R syntax I receive the following error
> >> > message:
> >> >
> >> > "Error: cannot allocate vector of size 216.0 Mb".
> >> >
> >> > This is an extract of my R syntax:
> >> >
> >> >
> >> >> memory.limit(4000)
> >> >>
> >> > NULL
> >> >
> >> >> simu.BYM<-bugs(data, inits, parameters, model.file="Modelo.txt", n.chains=3, n.iter=200000, n.burnin=20000, n.thin=180, debug=FALSE, DIC=FALSE, digits=5, codaPkg=FALSE, bugs.directory="c:/Archivos de programa/WinBUGS14", working.directory=NULL)
> >> >>
> >> > Error: cannot allocate vector of size 216.0 Mb
> >> >
> >> > I have tried:
> >> > -Change size of virtual memory inside Windows XP
> >> > -change the R memory settings
> >> > -run from DOS (R CMD BATCH...)
> >> > -reviewed the R Windows FAQ and R-Help.
> >> >
> >> > but I haven't be able to find a solution !
> >> Could you try R-patched?  I recently fixed a minor bug that could have
> >> symptoms like this. Under certain conditions it would miscalculate the
> >> amount of available memory.  You can download a copy from
> >> cran.r-project.org/bin/windows/base/rpatched.html.
> >>
> >> Duncan Murdoch
> >>
> >
> > Dear Duncan,
> >
> > Thank for your advice. But, the patched version produce the same error.
>
> In that case, you are probably really running out of memory.  It's hard
> to see why this would happen on the larger machine and not the smaller
> one, but perhaps the code tries to adapt itself to available resources.
>   You are likely to have a bit of work diagnosing the problem.
>
> The tools to use are memory.size(), memory.limit() (which report on what
> is available); memory.profile() (which gives more detail on usage).
> Rprofmem() would also be nice, but it's not enabled in the standard
> Windows build.
>
> Duncan Murdoch
>

Dear Duncan,

I have tried to run the same syntax in another pc (with exactly the
same mark and model as mine) and I have obtained the same error. Then
we can rule out that it is a problem with the hardware of my pc.

I have tried to change the memory with command --max-mem-size=4000M
("c:\...\Rgui.exe" --max-mem-size=4000Mb)  but I obtain this alert:

WARNING: --max-mem-size=4000M: too large and taken as 2047

Here I show you the parameters of memory that I obtain before and
after I run my syntax, and the gc() results obtained during the
process. Perhaps this values can help you.

thank you,

Rodrigo


############# Memory values before I run the syntax###############

> memory.limit()
[1] 1535.875
> memory.size()
[1] 29.42623
> memory.profile()
       NULL      symbol    pairlist     closure environment     promise
          1        9368      407965       12045        2013        7091
   language     special     builtin        char     logical     integer
     107052         269        2397       11503       13032        8429
     double     complex   character         ...         any        list
      11122          17      122950           1           0        7535
 expression    bytecode externalptr     weakref         raw
          1           0        1341         359           1
> gc()
         used (Mb) gc trigger (Mb) max used (Mb)
Ncells 727690 19.5    1166886 31.2   984024 26.3
Vcells 282062  2.2     786432  6.0   519695  4.0

############# Memory values after I run the syntax###############

> memory.limit()
[1] 4000
> memory.size()
[1] 1417.948
> memory.profile()
       NULL      symbol    pairlist     closure environment     promise
          1        9921      466736       12211        2013        7091
   language     special     builtin        char     logical     integer
     114491         269        2397       14534       13341       46991
     double     complex   character         ...         any        list
      35508          17      131349           1           0       14663
 expression    bytecode externalptr     weakref         raw
          1           0        1324         342           1
> gc()
          used (Mb) gc trigger  (Mb)  max used   (Mb)
Ncells  876371 23.5    1835812  49.1   1835812   49.1
Vcells 1247398  9.6  121622414 928.0 180932899 1380.5
> memory.size(TRUE)
[1] 1541.688


############# gc() values during the process###############


Garbage collection 330 = 271+30+29 (level 2) ...
23.6 Mbytes of cons cells used (48%)
9.9 Mbytes of vectors used (8%)
Garbage collection 331 = 271+30+30 (level 2) ...
23.6 Mbytes of cons cells used (48%)
117.8 Mbytes of vectors used (49%)
Garbage collection 332 = 271+30+31 (level 2) ...
23.6 Mbytes of cons cells used (48%)
225.8 Mbytes of vectors used (64%)
Garbage collection 333 = 271+30+32 (level 2) ...
23.6 Mbytes of cons cells used (48%)
333.8 Mbytes of vectors used (72%)
Garbage collection 334 = 272+30+32 (level 0) ...
23.6 Mbytes of cons cells used (48%)
441.9 Mbytes of vectors used (95%)
Garbage collection 335 = 272+31+32 (level 1) ...
23.7 Mbytes of cons cells used (48%)
441.9 Mbytes of vectors used (95%)
Garbage collection 336 = 272+31+33 (level 2) ...
23.8 Mbytes of cons cells used (48%)
226.0 Mbytes of vectors used (49%)
Garbage collection 337 = 273+31+33 (level 0) ...
23.8 Mbytes of cons cells used (48%)
226.0 Mbytes of vectors used (49%)
Garbage collection 338 = 274+31+33 (level 0) ...
24.1 Mbytes of cons cells used (49%)
288.7 Mbytes of vectors used (62%)
Garbage collection 339 = 274+31+34 (level 2) ...
24.1 Mbytes of cons cells used (49%)
351.1 Mbytes of vectors used (55%)
Garbage collection 340 = 274+31+35 (level 2) ...
24.1 Mbytes of cons cells used (49%)
476.1 Mbytes of vectors used (72%)
Garbage collection 341 = 274+31+36 (level 2) ...
24.1 Mbytes of cons cells used (49%)
406.1 Mbytes of vectors used (58%)
Garbage collection 342 = 275+31+36 (level 0) ...
24.1 Mbytes of cons cells used (49%)
550.1 Mbytes of vectors used (79%)
Garbage collection 343 = 275+31+37 (level 2) ...
24.1 Mbytes of cons cells used (49%)
298.2 Mbytes of vectors used (41%)
Garbage collection 344 = 275+31+38 (level 2) ...
24.1 Mbytes of cons cells used (49%)
406.1 Mbytes of vectors used (53%)
Garbage collection 345 = 275+31+39 (level 2) ...
24.1 Mbytes of cons cells used (49%)
576.6 Mbytes of vectors used (71%)
Garbage collection 346 = 275+31+40 (level 2) ...
24.1 Mbytes of cons cells used (49%)
639.1 Mbytes of vectors used (68%)
Garbage collection 347 = 275+31+41 (level 2) ...
24.1 Mbytes of cons cells used (49%)
764.1 Mbytes of vectors used (78%)
Garbage collection 348 = 275+31+42 (level 2) ...
24.1 Mbytes of cons cells used (49%)
694.0 Mbytes of vectors used (67%)
Garbage collection 349 = 276+31+42 (level 0) ...
24.1 Mbytes of cons cells used (49%)
869.3 Mbytes of vectors used (84%)
Garbage collection 350 = 276+31+43 (level 2) ...
24.1 Mbytes of cons cells used (49%)
576.6 Mbytes of vectors used (56%)
Garbage collection 351 = 277+31+43 (level 0) ...
24.1 Mbytes of cons cells used (49%)
826.6 Mbytes of vectors used (80%)
Garbage collection 352 = 277+32+43 (level 1) ...
24.1 Mbytes of cons cells used (49%)
694.0 Mbytes of vectors used (67%)
Garbage collection 353 = 278+32+43 (level 0) ...
24.1 Mbytes of cons cells used (49%)
838.4 Mbytes of vectors used (81%)
Garbage collection 354 = 278+33+43 (level 1) ...
24.1 Mbytes of cons cells used (49%)
694.5 Mbytes of vectors used (67%)
Garbage collection 355 = 279+33+43 (level 0) ...
24.2 Mbytes of cons cells used (49%)
802.6 Mbytes of vectors used (78%)
Garbage collection 356 = 280+33+43 (level 0) ...
24.4 Mbytes of cons cells used (50%)
803.7 Mbytes of vectors used (78%)
Garbage collection 357 = 281+33+43 (level 0) ...
24.4 Mbytes of cons cells used (50%)
803.7 Mbytes of vectors used (78%)
Garbage collection 358 = 282+33+43 (level 0) ...
24.4 Mbytes of cons cells used (50%)
803.8 Mbytes of vectors used (78%)
Garbage collection 359 = 283+33+43 (level 0) ...
24.4 Mbytes of cons cells used (50%)
803.8 Mbytes of vectors used (78%)
Garbage collection 360 = 284+33+43 (level 0) ...
24.4 Mbytes of cons cells used (50%)
803.8 Mbytes of vectors used (78%)
Garbage collection 361 = 285+33+43 (level 0) ...
24.4 Mbytes of cons cells used (50%)
803.9 Mbytes of vectors used (78%)
Garbage collection 362 = 286+33+43 (level 0) ...
24.4 Mbytes of cons cells used (50%)
803.9 Mbytes of vectors used (78%)
Garbage collection 363 = 287+33+43 (level 0) ...
24.4 Mbytes of cons cells used (50%)
803.9 Mbytes of vectors used (78%)
Garbage collection 364 = 288+33+43 (level 0) ...
24.4 Mbytes of cons cells used (50%)
804.0 Mbytes of vectors used (78%)
Garbage collection 365 = 288+34+43 (level 1) ...
24.2 Mbytes of cons cells used (49%)
803.5 Mbytes of vectors used (78%)
Garbage collection 366 = 289+34+43 (level 0) ...
24.2 Mbytes of cons cells used (49%)
803.6 Mbytes of vectors used (78%)
Garbage collection 367 = 290+34+43 (level 0) ...
24.2 Mbytes of cons cells used (49%)
803.6 Mbytes of vectors used (78%)
Garbage collection 368 = 291+34+43 (level 0) ...
24.2 Mbytes of cons cells used (49%)
803.7 Mbytes of vectors used (78%)
Garbage collection 369 = 292+34+43 (level 0) ...
24.2 Mbytes of cons cells used (49%)
803.7 Mbytes of vectors used (78%)
Garbage collection 370 = 293+34+43 (level 0) ...
24.2 Mbytes of cons cells used (49%)
803.8 Mbytes of vectors used (78%)
Garbage collection 371 = 294+34+43 (level 0) ...
24.2 Mbytes of cons cells used (49%)
803.8 Mbytes of vectors used (78%)
Garbage collection 372 = 295+34+43 (level 0) ...
24.2 Mbytes of cons cells used (49%)
803.9 Mbytes of vectors used (78%)
Garbage collection 373 = 296+34+43 (level 0) ...
24.2 Mbytes of cons cells used (49%)
803.9 Mbytes of vectors used (78%)
Garbage collection 374 = 297+34+43 (level 0) ...
24.2 Mbytes of cons cells used (49%)
804.0 Mbytes of vectors used (78%)
Garbage collection 375 = 298+34+43 (level 0) ...
24.2 Mbytes of cons cells used (49%)
804.0 Mbytes of vectors used (78%)
Garbage collection 376 = 299+34+43 (level 0) ...
24.2 Mbytes of cons cells used (49%)
804.1 Mbytes of vectors used (78%)
Garbage collection 377 = 300+34+43 (level 0) ...
24.2 Mbytes of cons cells used (49%)
804.1 Mbytes of vectors used (78%)
Garbage collection 378 = 301+34+43 (level 0) ...
24.2 Mbytes of cons cells used (49%)
804.2 Mbytes of vectors used (78%)
Garbage collection 379 = 302+34+43 (level 0) ...
24.2 Mbytes of cons cells used (49%)
804.2 Mbytes of vectors used (78%)
Garbage collection 380 = 303+34+43 (level 0) ...
24.2 Mbytes of cons cells used (49%)
804.3 Mbytes of vectors used (78%)
Garbage collection 381 = 304+34+43 (level 0) ...
24.3 Mbytes of cons cells used (49%)
804.3 Mbytes of vectors used (78%)
Garbage collection 382 = 305+34+43 (level 0) ...
24.3 Mbytes of cons cells used (49%)
804.4 Mbytes of vectors used (78%)
Garbage collection 383 = 306+34+43 (level 0) ...
24.3 Mbytes of cons cells used (49%)
804.4 Mbytes of vectors used (78%)
Garbage collection 384 = 307+34+43 (level 0) ...
24.3 Mbytes of cons cells used (49%)
804.5 Mbytes of vectors used (78%)
Garbage collection 385 = 308+34+43 (level 0) ...
24.3 Mbytes of cons cells used (49%)
804.5 Mbytes of vectors used (78%)
Garbage collection 386 = 308+35+43 (level 1) ...
24.2 Mbytes of cons cells used (49%)
803.6 Mbytes of vectors used (78%)
Garbage collection 387 = 309+35+43 (level 0) ...
24.2 Mbytes of cons cells used (49%)
803.7 Mbytes of vectors used (78%)
Garbage collection 388 = 310+35+43 (level 0) ...
24.2 Mbytes of cons cells used (49%)
803.7 Mbytes of vectors used (78%)
Garbage collection 389 = 311+35+43 (level 0) ...
24.2 Mbytes of cons cells used (49%)
803.8 Mbytes of vectors used (78%)
Garbage collection 390 = 312+35+43 (level 0) ...
24.2 Mbytes of cons cells used (49%)
803.9 Mbytes of vectors used (78%)
Garbage collection 391 = 313+35+43 (level 0) ...
24.2 Mbytes of cons cells used (49%)
803.9 Mbytes of vectors used (78%)
Garbage collection 392 = 314+35+43 (level 0) ...
24.2 Mbytes of cons cells used (49%)
804.0 Mbytes of vectors used (78%)
Garbage collection 393 = 315+35+43 (level 0) ...
24.2 Mbytes of cons cells used (49%)
804.1 Mbytes of vectors used (78%)
Garbage collection 394 = 316+35+43 (level 0) ...
24.2 Mbytes of cons cells used (49%)
804.1 Mbytes of vectors used (78%)
Garbage collection 395 = 317+35+43 (level 0) ...
24.2 Mbytes of cons cells used (49%)
804.2 Mbytes of vectors used (78%)
Garbage collection 396 = 318+35+43 (level 0) ...
24.2 Mbytes of cons cells used (49%)
804.2 Mbytes of vectors used (78%)
Garbage collection 397 = 319+35+43 (level 0) ...
24.2 Mbytes of cons cells used (49%)
804.2 Mbytes of vectors used (78%)
Garbage collection 398 = 320+35+43 (level 0) ...
24.2 Mbytes of cons cells used (49%)
804.3 Mbytes of vectors used (78%)
Garbage collection 399 = 321+35+43 (level 0) ...
24.2 Mbytes of cons cells used (49%)
804.4 Mbytes of vectors used (78%)
Garbage collection 400 = 322+35+43 (level 0) ...
24.2 Mbytes of cons cells used (49%)
804.4 Mbytes of vectors used (78%)
Garbage collection 401 = 323+35+43 (level 0) ...
24.3 Mbytes of cons cells used (49%)
804.5 Mbytes of vectors used (78%)
Garbage collection 402 = 324+35+43 (level 0) ...
24.3 Mbytes of cons cells used (49%)
804.5 Mbytes of vectors used (78%)
Garbage collection 403 = 325+35+43 (level 0) ...
24.3 Mbytes of cons cells used (49%)
804.6 Mbytes of vectors used (78%)
Garbage collection 404 = 326+35+43 (level 0) ...
24.3 Mbytes of cons cells used (49%)
804.7 Mbytes of vectors used (78%)
Garbage collection 405 = 327+35+43 (level 0) ...
24.3 Mbytes of cons cells used (49%)
804.7 Mbytes of vectors used (78%)
Garbage collection 406 = 328+35+43 (level 0) ...
24.3 Mbytes of cons cells used (49%)
804.8 Mbytes of vectors used (78%)
Garbage collection 407 = 328+36+43 (level 1) ...
24.2 Mbytes of cons cells used (49%)
803.6 Mbytes of vectors used (78%)
Garbage collection 408 = 329+36+43 (level 0) ...
24.2 Mbytes of cons cells used (49%)
803.7 Mbytes of vectors used (78%)
Garbage collection 409 = 330+36+43 (level 0) ...
24.2 Mbytes of cons cells used (49%)
803.7 Mbytes of vectors used (78%)
Garbage collection 410 = 331+36+43 (level 0) ...
24.2 Mbytes of cons cells used (49%)
803.8 Mbytes of vectors used (78%)
Garbage collection 411 = 332+36+43 (level 0) ...
24.2 Mbytes of cons cells used (49%)
803.9 Mbytes of vectors used (78%)
Garbage collection 412 = 333+36+43 (level 0) ...
24.2 Mbytes of cons cells used (49%)
803.9 Mbytes of vectors used (78%)
Garbage collection 413 = 334+36+43 (level 0) ...
24.2 Mbytes of cons cells used (49%)
804.0 Mbytes of vectors used (78%)
Garbage collection 414 = 335+36+43 (level 0) ...
24.2 Mbytes of cons cells used (49%)
804.1 Mbytes of vectors used (78%)
Garbage collection 415 = 336+36+43 (level 0) ...
24.2 Mbytes of cons cells used (49%)
804.2 Mbytes of vectors used (78%)
Garbage collection 416 = 337+36+43 (level 0) ...
24.2 Mbytes of cons cells used (49%)
804.2 Mbytes of vectors used (78%)
Garbage collection 417 = 338+36+43 (level 0) ...
24.2 Mbytes of cons cells used (49%)
804.3 Mbytes of vectors used (78%)
Garbage collection 418 = 339+36+43 (level 0) ...
24.2 Mbytes of cons cells used (49%)
804.3 Mbytes of vectors used (78%)
Garbage collection 419 = 340+36+43 (level 0) ...
24.2 Mbytes of cons cells used (49%)
804.4 Mbytes of vectors used (78%)
Garbage collection 420 = 341+36+43 (level 0) ...
24.2 Mbytes of cons cells used (49%)
804.5 Mbytes of vectors used (78%)
Garbage collection 421 = 342+36+43 (level 0) ...
24.2 Mbytes of cons cells used (49%)
804.5 Mbytes of vectors used (78%)
Garbage collection 422 = 343+36+43 (level 0) ...
24.2 Mbytes of cons cells used (49%)
804.6 Mbytes of vectors used (78%)
Garbage collection 423 = 344+36+43 (level 0) ...
24.3 Mbytes of cons cells used (49%)
804.7 Mbytes of vectors used (78%)
Garbage collection 424 = 345+36+43 (level 0) ...
24.3 Mbytes of cons cells used (49%)
804.8 Mbytes of vectors used (78%)
Garbage collection 425 = 346+36+43 (level 0) ...
24.3 Mbytes of cons cells used (49%)
804.9 Mbytes of vectors used (78%)
Garbage collection 426 = 347+36+43 (level 0) ...
24.3 Mbytes of cons cells used (49%)
804.9 Mbytes of vectors used (78%)
Garbage collection 427 = 348+36+43 (level 0) ...
24.3 Mbytes of cons cells used (49%)
805.0 Mbytes of vectors used (78%)
Garbage collection 428 = 348+36+44 (level 2) ...
24.2 Mbytes of cons cells used (49%)
515.0 Mbytes of vectors used (50%)
Garbage collection 429 = 349+36+44 (level 0) ...
24.2 Mbytes of cons cells used (49%)
515.1 Mbytes of vectors used (50%)
Garbage collection 430 = 350+36+44 (level 0) ...
24.2 Mbytes of cons cells used (49%)
515.1 Mbytes of vectors used (50%)
Garbage collection 431 = 351+36+44 (level 0) ...
24.2 Mbytes of cons cells used (49%)
515.2 Mbytes of vectors used (50%)
Garbage collection 432 = 352+36+44 (level 0) ...
24.2 Mbytes of cons cells used (49%)
515.3 Mbytes of vectors used (50%)
Garbage collection 433 = 353+36+44 (level 0) ...
24.2 Mbytes of cons cells used (49%)
515.3 Mbytes of vectors used (50%)
Garbage collection 434 = 354+36+44 (level 0) ...
24.2 Mbytes of cons cells used (49%)
515.4 Mbytes of vectors used (50%)
Garbage collection 435 = 355+36+44 (level 0) ...
24.2 Mbytes of cons cells used (49%)
515.5 Mbytes of vectors used (50%)
Garbage collection 436 = 356+36+44 (level 0) ...
24.2 Mbytes of cons cells used (49%)
515.6 Mbytes of vectors used (50%)
Garbage collection 437 = 357+36+44 (level 0) ...
24.2 Mbytes of cons cells used (49%)
515.7 Mbytes of vectors used (50%)
Garbage collection 438 = 358+36+44 (level 0) ...
24.2 Mbytes of cons cells used (49%)
515.8 Mbytes of vectors used (50%)
Garbage collection 439 = 359+36+44 (level 0) ...
24.2 Mbytes of cons cells used (49%)
515.9 Mbytes of vectors used (50%)
Garbage collection 440 = 360+36+44 (level 0) ...
24.2 Mbytes of cons cells used (49%)
516.0 Mbytes of vectors used (50%)
Garbage collection 441 = 361+36+44 (level 0) ...
24.2 Mbytes of cons cells used (49%)
516.0 Mbytes of vectors used (50%)
Garbage collection 442 = 362+36+44 (level 0) ...
24.3 Mbytes of cons cells used (49%)
516.1 Mbytes of vectors used (50%)
Garbage collection 443 = 363+36+44 (level 0) ...
24.3 Mbytes of cons cells used (49%)
516.2 Mbytes of vectors used (50%)
Garbage collection 444 = 364+36+44 (level 0) ...
24.3 Mbytes of cons cells used (49%)
516.2 Mbytes of vectors used (50%)
Garbage collection 445 = 365+36+44 (level 0) ...
24.3 Mbytes of cons cells used (49%)
516.3 Mbytes of vectors used (50%)
Garbage collection 446 = 366+36+44 (level 0) ...
24.3 Mbytes of cons cells used (49%)
516.4 Mbytes of vectors used (50%)
Garbage collection 447 = 367+36+44 (level 0) ...
24.3 Mbytes of cons cells used (49%)
516.4 Mbytes of vectors used (50%)
Garbage collection 448 = 368+36+44 (level 0) ...
24.3 Mbytes of cons cells used (49%)
516.5 Mbytes of vectors used (50%)
Garbage collection 449 = 368+37+44 (level 1) ...
24.2 Mbytes of cons cells used (49%)
515.0 Mbytes of vectors used (50%)
Garbage collection 450 = 369+37+44 (level 0) ...
24.2 Mbytes of cons cells used (49%)
839.2 Mbytes of vectors used (81%)
Garbage collection 451 = 369+38+44 (level 1) ...
24.2 Mbytes of cons cells used (49%)
893.2 Mbytes of vectors used (87%)
Garbage collection 452 = 369+38+45 (level 2) ...
24.2 Mbytes of cons cells used (49%)
731.1 Mbytes of vectors used (67%)
Garbage collection 453 = 369+38+46 (level 2) ...
24.2 Mbytes of cons cells used (49%)
947.2 Mbytes of vectors used (77%)
Garbage collection 454 = 369+38+47 (level 2) ...
24.2 Mbytes of cons cells used (49%)
1217.2 Mbytes of vectors used (91%)
Garbage collection 455 = 369+38+48 (level 2) ...
24.2 Mbytes of cons cells used (49%)
1325.1 Mbytes of vectors used (91%)
Garbage collection 456 = 369+38+49 (level 2) ...
24.4 Mbytes of cons cells used (50%)
1380.4 Mbytes of vectors used (82%)
Garbage collection 457 = 370+38+49 (level 0) ...
24.4 Mbytes of cons cells used (50%)
1380.4 Mbytes of vectors used (82%)
Error: cannot allocate vector of size 216.0 Mb




More information about the R-help mailing list