[R] memory problem; Error: cannot allocate vector of size 915.5 Mb
Dimitris.Kapetanakis
dimitrios.kapetanakis at gmail.com
Sun Jul 31 17:53:39 CEST 2011
Dear all,
I am trying to make some matrix operations (whose size I think is smaller
than what R allows) but the operations are not feasible when they run in one
session but it is feasible if they run separately while each operation is
totally independent of the other. I run the code in one session the error
that appears is:
Error: cannot allocate vector of size 915.5 Mb
R(16467,0xa0421540) malloc: *** mmap(size=960004096) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
R(16467,0xa0421540) malloc: *** mmap(size=960004096) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
In the code that I run (next lines), if I do not include the last three
lines it runs perfectly, if I exclude operations to create the xMax again it
runs perfectly, if I include both G.search and xMax appears the error term.
Does anyone knows the solution of this problem or why this problem happens?
The code that I run is:
N<-250
x<-matrix(c(rnorm(N,-1.5,1), rnorm(N,1,1), rbinom(N,1,0.5)), ncol=3)
start<-(-1)
end<-3
step<-10^(-2)
n.steps<-(end-start)/step
steps2 <-n.steps^2
grids<-seq(from=start+step, to=end, by=step)
xMax <-matrix(0,N*steps2,3)
xMax[,1]<-rep(x[,1],steps2)
xMax[,2]<-rep(x[,2],steps2)
xMax[,3]<-rep(x[,3],steps2)
G.search1<-as.matrix(rep(grids, n.steps, each=N))
G.search2<-as.matrix(rep(grids, N, each=n.steps))
G.search<-cbind(1,G.search1, G.search2)
Thank you
Dimitris
--
View this message in context: http://r.789695.n4.nabble.com/memory-problem-Error-cannot-allocate-vector-of-size-915-5-Mb-tp3707943p3707943.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list