[STATSGRASS] memory issues.

Daniel McInerney daniel.mcinerney at ucd.ie
Wed Apr 5 14:54:30 EDT 2006

Hello list,

I've been using R/GRASS for satellite
image classification and I've been content
with it's capabilities. I recently changed
study area and increased the number
of image bands being used for classification
and began to encounter a series of memory
related issues during R sessions.

GRASS rasters are read in using
'readCELL6sp' and then stored as a data.frame
>tmpimg <- data.frame(readCELL6sp("rasterlayer")[,1])

The current study region is composed of approximately
3989808 pixels and up to 15 bands. The .RData file
is in excess of 700Mb.

Various error messages have been returned during the
The following when reading in the grass rasters
$>"cannot open file '/tmp/RtmpRAYfK2/file74b0dc51', reason
        'No such file or directory"  

There is no shortage of space available in the partition
within which /tmp resides.

The following during image classification. It occurs
during the  second iteration after modification of
parameters and the first classification has been
written to GRASS with 'writeRast6':

$>Error: cannot allocate vector of size 187022 Kb

When trying to edit functions after above errors
$>Error in edit(name, file, title, editor) :
        problem with running editor vi

I've included gc() in my functions as well as removing
temporary objects during runtime. I recompiled R to
enable linux-lfs and 64bit libs. I've also started R with
various combinations of --max/min-vsize and --max/min-nsize
However, none of these have greatly improved the situation.

I'm writing to know whether anyone has encountered
something similar and whether a work around exists? Am
I asking too much of R or am I overlooking something?

Any advice or suggestions would be greatly appreciated.

Thanks in advance,



Debian 2.6.8-11-amd64
R 2.2.1
sp 0.8-9
spgrass6 0.1.3
spGDAL 0.1.1
spproj 0.3-2
GRASS 6.1 cvs 25.02.06

More information about the grass-stats mailing list