Hi Sandra, On Fri, Jun 20, 2014 at 7:49 AM, Markus Neteler <[email protected]> wrote: > On Sat, Jun 14, 2014 at 9:21 AM, Sandra MacFadyen <[email protected]> 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@landsat -a
r.li.simpson --o input=lsat5_1987_10@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
conf_diversity_5.0
Description: Binary data
_______________________________________________ grass-user mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/grass-user
