[GRASS-user] Question on memory allocation and use

Rich Shepard rshepard at appl-ecosys.com
Thu Sep 22 08:45:49 PDT 2016


   A possible bug in ../diglib/cindex.c.

   This host has 4G RAM and 16G swap memory. With X running top shows 740M
RAM and 15.3G swap free. I'm trying to run a spatial analysis program which
fails after 2.5-4.7 hours (depending on the contour resolutions). This
morning after 2.5 hours it failed with this message:

ERROR: G_realloc: unable to allocate 52980000 bytes of memory at
        lib/vector/diglib/cindex.c:113

which is approximately 52M.

   This is cindex.c (it's the same in the latest svn checkouts of 7.0, 7.2,
and 7.3):

     /* Add new cat - line record */
     ci = &(Plus->cidx[si]);
     if (ci->n_cats == ci->a_cats) {
         ci->a_cats += 5000;
         ci->cat = G_realloc(ci->cat, ci->a_cats * 3 * sizeof(int));
     }
lines 109-114.

   While waiting for an answer -- or a fix -- I'll kill X and try running
r.contour from a console and see if the extra memory does the job. My
project is stalled until I can create vector contours from the LiDAR raster
maps.

TIA,

Rich


More information about the grass-user mailing list