[GRASS-user] Question on memory allocation and use
Markus Metz
markus.metz.giswork at gmail.com
Fri Sep 23 05:46:24 PDT 2016
On Thu, Sep 22, 2016 at 5:45 PM, Rich Shepard <rshepard at appl-ecosys.com> wrote:
> 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.
Apparently there are less than 52 MB of free memory left. The
resulting vector contours must be quite large. Try to
export GRASS_VECTOR_LOWMEM=1
before running r.contour.
Maybe also use a larger step or less levels.
HTH,
Markus M
>
> 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
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
More information about the grass-user
mailing list