[R] memory

Thomas Lumley tlumley at u.washington.edu
Tue Oct 30 22:01:40 CET 2001


On Tue, 30 Oct 2001, Geert Aarts wrote:

> Dear List
>
> I would like to apply kriging (using sgeostat or fields package)
> The result I got is as follows:
>
> >Error: Cannot allocate vector of size 41148 Kb
> >In addition: Warning Message:
> >Reached total allocation of 255 Mb. See help(memory)
>
> >memory.size(max=TRUE)
> 250,834,944
>
> >memory.size()
> 95,052,192
>
> In other words. R should be able to allocate the vector of 41Mb!!!!
> What is the problem?

Presumably the function has already allocated a lot of memory (say, 150Mb)
before it tries to do the 41Mb allocation that triggers the error.  In
responding to the error R will unallocate all the memory that the function
had previously allocated.  You could confirm this by
  gcinfo(TRUE)
which would make R report the currently used memory size with each garbage
collection.

To set the --max-mem-size option (or any other command line option), add
it to the 'Target' field in the 'Properties' for the shortcut to R.

eg
"C:\Program Files\R\rw1030\bin\Rgui.exe" --max-mem-size=300M


	-thomas

Thomas Lumley			Asst. Professor, Biostatistics
tlumley at u.washington.edu	University of Washington, Seattle

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list