Re: [R] memory allocation failures

From: Prof Brian Ripley <>
Date: Tue 21 Jun 2005 - 17:34:38 EST

Most likely your linear model fitting is too large for the amount of memory you have in your Windows box. However, you should check ?Memory and in particular how your maximum RAM usage is set. (I don't know how the `JGR JRI tools' give you access to R's startup settings.)

It may be that you are creating lots of large objects and so filling memory that way: try running gc() before the call to check your memory usage. If so, you can remove (or save()) previous work.

On Mon, 20 Jun 2005, Matthew Padilla wrote:

> Hi,
> I am running R version rw2010 on a Windows 2000 desktop. I am invoking R
> from Java via the JGR JRI tools. My process consists of repeated calls to R
> in order to create linear models and process the resulting statistics. I
> find, however, that the process often dies due to memory allocation errors:
> lm command:
> .model_resp10_1=lm(resp10_1~rannor10+rannor11+rannor13+rannor14+rannor15+rannor18+rannor23+rannor26+rannor28+rannor29+rannor32+rannor33+rannor35+rannor36+rannor39+rannor40+rannor43+rannor44+rannor46+rannor47+rannor48+rannor50+rannor51+rannor53+rannor55+rannor56+rannor57+rannor59).
> Garbage collection 172 = 54+41+77 (level 2) ...
> 626936 cons cells free (75%)
> 12.5 Mbytes of heap free (15%)
> Error: cannot allocate vector of size 2265 Kb
> I have tried to remedy this situation by corresponding calls to gc(), but
> this does not seem to fix the problem. My files are not that large - about
> 1000 records. Additionally, general communication to R from Java from JRI
> does seem to work - I only run into problems when repeatedly creating models
> as demonstrated above.
> Any help would be greatly appreciated - I am very much an R newbie.
> Thank you,
> Matthew
> ______________________________________________
> mailing list
> PLEASE do read the posting guide!

Brian D. Ripley,        
Professor of Applied Statistics,
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________ mailing list
PLEASE do read the posting guide!
Received on Tue Jun 21 17:44:02 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:55 EST