[R] memory allocation

Roger Bivand Roger.Bivand at nhh.no
Tue Nov 16 18:29:25 CET 2004


On Tue, 16 Nov 2004, Massimiliano Copetti wrote:

> 
> Dear sirs,
> 
> I'm using the Splancs package to compute standard errors of the
> estimates of a spatio-temporal k function. When I use as spatial and
> temporal distances too long vectors (respectively 60 and 80 entries) for
> a dataset of 1000 observations, R gives me the message

The memory demands arise in stvmat() called inside stsecal(), in which an 
(s*tm)*(s*tm) numeric matrix is allocated, described in the code as a 
"full spacetime variance/covariance matrix", and which is necessarily 
large. In your case 23040000 elements are used of 8 bytes each, so to do 
this in the way you describe you need more RAM - the matrix may be copied 
as well. The authors of the package and the underlying method did not 
anticipate needing this high degree of spatial and temporal resolution.

Roger Bivand

> 
> Error: cannot allocate vector of size 180000 Kb
> 
> Reached total allocation of 512 Mb.
> 
> I ran the function memory.size() and obtained 392000000 more or less.
> 
> Can anyone help me? 
> 
> Thanks in advance.
> 
> Massimiliano Copetti
> 
> 
> 
> 

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Breiviksveien 40, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93
e-mail: Roger.Bivand at nhh.no




More information about the R-help mailing list