From luke at stat.uiowa.edu  Fri Nov 14 19:04:20 2008
From: luke at stat.uiowa.edu (Luke Tierney)
Date: Fri, 14 Nov 2008 12:04:20 -0600 (CST)
Subject: [Rd] error during list allocation
In-Reply-To: <4919EDD4.5070009@idi.ntnu.no>
References: <4919EDD4.5070009@idi.ntnu.no>
Message-ID: <alpine.LFD.2.00.0811141202230.17698@nokomis.stat.uiowa.edu>

Thanks for the report -- I was able to reproduce it on my systems by
setting the process memory limit to a fairly low value (otherwise I
just get into paging).

The page allocation code should have done a GC after malloc failure
and tried again; this is now fixed in R-devel and R-patched.

luke

On Tue, 11 Nov 2008, Wacek Kusnierczyk wrote:

> platform       i686-pc-linux-gnu
> arch           i686
> os             linux-gnu
> system         i686, linux-gnu
> status
> major          2
> minor          8.0
> year           2008
> month          10
> day            20
> svn rev        46754
> language       R
> version.string R version 2.8.0 (2008-10-20)
>
>
> when i try to allocate a large list, i get the following error:
>
> Error: vector memory exhausted (limit reached?)
>
> the process uses over 80% memory, and cannot be stopped from within r
> (it responds to whatever input with the same message as above); i need
> to kill the process to release resources.
>
> i think it would be practical to have the error reported *and* resources
> freed when allocation fails.
> the following should make a reproducible example:
>
> x = 1:(10^9)
> # Error: cannot allocate vector of size 3.7 Gb
> # no problem otherwise
>
> x = as.list(1:(10^8))
> # Error: vector memory exhausted (limit reached?)
> quit()
> # Error: vector memory exhausted (limit reached?)
> 1
> # Error: vector memory exhausted (limit reached?)
>
> vQ
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

-- 
Luke Tierney
Chair, Statistics and Actuarial Science
Ralph E. Wareham Professor of Mathematical Sciences
University of Iowa                  Phone:             319-335-3386
Department of Statistics and        Fax:               319-335-3017
    Actuarial Science
241 Schaeffer Hall                  email:      luke at stat.uiowa.edu
Iowa City, IA 52242                 WWW:  http://www.stat.uiowa.edu



[Rd] error during list allocation
Luke Tierney