[R] memory problem under windows

Christoph Lehmann christoph.lehmann at gmx.ch
Tue Sep 14 22:09:27 CEST 2004


I have (still) some memory problems, when trying to allocate a huge array:

WinXP pro, with 2G RAM

I start R by calling:	

Rgui.exe --max-mem-size=2Gb (as pointed out in R for windows FAQ)

R.Version(): i386-pc-mingw32, 9.1, 21.6.2004

## and here the problem
x.dim <- 46
y.dim <- 58
slices <- 40
volumes <- 1040
a <- rep(0, x.dim * y.dim * slices * volumes)
dim(a) <- c(x.dim, y.dim, slices, volumes)

gives me: "Error: cannot allocate vector of size 850425 Kb"

even though

memory.limit(size = NA)
yields 	2147483648

and

memory.size()
gives 905838768

so why is that and what can I do against it?

Many thanks for your kind help

Cheers

Christoph

-- 
Christoph Lehmann                            Phone:  ++41 31 930 93 83
Department of Psychiatric Neurophysiology    Mobile: ++41 76 570 28 00
University Hospital of Clinical Psychiatry   Fax:    ++41 31 930 99 61
Waldau                                            lehmann at puk.unibe.ch
CH-3000 Bern 60         http://www.puk.unibe.ch/cl/pn_ni_cv_cl_03.html




More information about the R-help mailing list