[Rd] memory trouble

Prof Brian Ripley ripley@stats.ox.ac.uk
Fri, 5 Jan 2001 11:06:47 +0000 (GMT)


On Thu, 4 Jan 2001, Martin Maechler wrote:

> In spite of Brian's good points, 
> I believe we should help the users more.
> 
> R-1.1.1 --vanilla     had
> 
>   rnorm(1e7)
> 
>   >> Error: heap memory (6144 Kb) exhausted [needed 78125 Kb more]
>   >>       See "help(Memory)" on how to increase the heap size.
> 
> which is much more helpful
> than the
> 
>   >> Error: cannot allocate vector of size 39062 Kb
> 
> that R-1.2.0  reports  (much much more rarely though, 
> 		        I couldn't reproduce it in a few tries !)


What I have done is to add a *warning* if the memory allocation is hit.
The warning is something like

   Reached total allocation of 191.36Mb: see help(memory.size)

I can't safely raise an error, and there are literally hundreds of 
places it could make an error, both in R and in a package.
You may or may not see the warning, depending how bad the error is.

Brian

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel 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-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._