[GRASS-user] execGRASS("r.diversity") Done. No rasters created (Large rasters)

Markus Neteler neteler at osgeo.org
Tue Jul 29 06:19:37 PDT 2014


Hi Sandra,

On Fri, Jun 20, 2014 at 7:49 AM, Markus Neteler <neteler at osgeo.org> wrote:
> On Sat, Jun 14, 2014 at 9:21 AM, Sandra MacFadyen <sandramf at live.co.za> wrote:
>> I am using r.diversity (GRASS GIS 7.0.0svn build 60785 win32) through R (R version 3.0.2 win32) on Windows 7 64bit.
...
>> However, when running the same code on a larger image (cells=6746328) from my own location, although it reports Done, no rasters are created. If I subset the image (cells=1632830) and run it again its works (see # sub2Kruger # code and results below). So I'm guessing it is a memory issue?

I tried again, directly executing the r.li.simpson command and one of
those called by r.dversity:

# NC dataset
g.region -p rast=lsat5_1987_10 at landsat -a

r.li.simpson --o input=lsat5_1987_10 at landsat \
   conf=conf_diversity_5.0 \
   output=lsat5_1987_div__simpson_size_5.0

It consumes (too much) memory.

Debugging it a bit. valgrind suggests that something leaking here:

# raster/r.li/r.li.daemon/avl.c, line 204
long avl_to_array(avl_node * root, long i, AVL_table * a)
{

    if (root != NULL) {
        i = avl_to_array(root->left_child, i, a);
        if (a == NULL)
            G_fatal_error("avl, avl_to_array: null value");
        else {
            a[i] = G_malloc(sizeof(AVL_tableRow));
            a[i]->k = root->key;
            a[i]->tot = root->counter;
            i++;
            i = avl_to_array(root->right_child, i, a);
        }
    }
    return i;
}

Memory is allocated in every call of avl_to_array() but perhaps not
properly freed later?
Any developer having an idea?

Markus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: conf_diversity_5.0
Type: application/octet-stream
Size: 84 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20140729/29c88357/attachment.obj>


More information about the grass-user mailing list