[R-br] Alocação de memória
Ari Clecius
ari072000 em yahoo.com.br
Terça Setembro 23 22:06:22 BRT 2014
Prezados colegas da lista, estava tentando rodar este exemplo quando tive problema de alocação de memória, alguém poderia me ajudar a resolver?
Att,
Ari Clecius Alves de Lima
Engenheiro Químico
Me. Engenharia Civil
(085)88412345
(085)33669042
#CMR
processador: Intel(R) Core(TM) i3 CPU M380 @2.53GHz
Memória instalada(RAM): 4,00 GB (utilizável:2,93)
Sistema oeracional de 32 Bits
R version 3.1.1 (2014-07-10) -- "Sock it to Me"
Copyright (C) 2014 The R Foundation for Statistical Computing
Platform: i386-w64-mingw32/i386 (32-bit)
N <- 100000000
x <- runif(N)
y <- runif(N)
ok <- sum(x^2 + y^2 < 1)
mc.pi <- 4 * ok / N
sprintf("pi = %.6lf\n", mc.pi)
#1ª tentativa
>N <- 100000000
>x <- runif(N)
> y <- runif(N)
Error: cannot allocate vector of size 762.9 Mb
In addition: Warning messages:
1: In runif(N) : Reached total allocation of 1535Mb: see help(memory.size)
2: In runif(N) : Reached total allocation of 1535Mb: see help(memory.size)
3: In runif(N) : Reached total allocation of 1535Mb: see help(memory.size)
4: In runif(N) : Reached total allocation of 1535Mb: see help(memory.size)
> ok <- sum(x^2 + y^2 < 1)
Error: cannot allocate vector of size 762.9 Mb
In addition: Warning messages:
1: Reached total allocation of 1535Mb: see help(memory.size)
2: Reached total allocation of 1535Mb: see help(memory.size)
3: Reached total allocation of 1535Mb: see help(memory.size)
4: Reached total allocation of 1535Mb: see help(memory.size)
> mc.pi <- 4 * ok / N
Error: object 'ok' not found
> sprintf("pi = %.6lf\n", mc.pi)
Error in sprintf("pi = %.6lf\n", mc.pi) : object 'mc.pi' not found
memory.size(2900)
2ª tentativa
> N <- 100000000
> x <- runif(N)
Error: cannot allocate vector of size 762.9 Mb
> y <- runif(N)
Error: cannot allocate vector of size 762.9 Mb
> ok <- sum(x^2 + y^2 < 1)
Error: cannot allocate vector of size 762.9 Mb
> mc.pi <- 4 * ok / N
Error: object 'ok' not found
> sprintf("pi = %.6lf\n", mc.pi)
Error in sprintf("pi = %.6lf\n", mc.pi) : object 'mc.pi' not found
-------------- Próxima Parte ----------
Um anexo em HTML foi limpo...
URL: <http://listas.inf.ufpr.br/pipermail/r-br/attachments/20140923/15c286b5/attachment.html>
Mais detalhes sobre a lista de discussão R-br