[R] memory allocation failures

Matthew Padilla mvfpadilla at hotmail.com
Mon Jun 20 23:37:28 CEST 2005


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




More information about the R-help mailing list