[GRASS-user] v.in.ogr G_realloc error

Hi, when I try to import a shapefile into GRASS I get this error message:
G_realloc: unable to allocate 18440000 bytes at struct_alloc.c:133

Command used:
v.in.ogr -o dsn=E:/temp/MSOA_AUG_2004_EW_BGC.shp output=eng_wales_osgb

If I use the '-c' option (dont clean polygons) I dont get the error but this
is no use as it results in some of the polygons going missing.
The shapefile is big but not that big and I can load the shapefile into
Quantum GIS and GMapCreator with no problems so I dont think there is
anything wrong with the shapefiles.
I have tried this with other shapefiles and projections and get a similar
error.
It also seems to be taking a very long time to import - literally hours.
I don't get the error with small shapfiles.
I'm using Windows7 64-bit, GRASS 6.4.0
Output log is pasted below.

Do you think this is an bug or is this not the correct way to import
shapefiles (I'm a GRASS complete beginner)?
Thanks.

v.in.ogr -o dsn=E:/temp/MSOA_AUG_2004_EW_BGC.shp output=eng_wales_osgb

Over-riding projection check

Layer: MSOA_AUG_2004_EW_BGC

?Default driver / database set to:

?driver: dbf

?database: $GISDBASE/$LOCATION_NAME/$MAPSET/dbf/

Importing map 7194 features...

-----------------------------------------------------

Building topology for vector map ...

Registering primitives...
   1000 2000 3000 4000 5000
6000 7000
7794 primitives registered

4448785 vertices registered

Building areas...

7794 areas built

7793 isles built

Attaching islands...

Attaching centroids...

Number of nodes: 7793

Number of primitives: 7794

Number of points: 0

Number of lines: 0

Number of boundaries: 7794

Number of centroids: 0

Number of areas: 7794

Number of isles: 7793

Number of areas without centroid: 7794

-----------------------------------------------------

?Cleaning polygons, result is not guaranteed!

Building topology for vector map ...

Number of nodes: 7793

Number of primitives: 7794

Number of points: 0

Number of lines: 0

Number of boundaries: 7794

Number of centroids: 0

Number of areas: -

Number of isles: -

-----------------------------------------------------

Break polygons:

-----------------------------------------------------

Remove duplicates:

-----------------------------------------------------

Break boundaries:

-----------------------------------------------------

Remove duplicates:

-----------------------------------------------------

Clean boundaries at nodes:

-----------------------------------------------------

Break boundaries:

?G_realloc: unable to allocate 19347180 bytes at struct_alloc.c:133
Finished with error

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/v-in-ogr-G-realloc-error-tp6352037p6352037.html
Sent from the Grass - Users mailing list archive at Nabble.com.

On Wed, May 11, 2011 at 4:19 PM, spiderplant0 <spiderplant0@gmail.com> wrote:

Hi, when I try to import a shapefile into GRASS I get this error message:
G_realloc: unable to allocate 18440000 bytes at struct_alloc.c:133

Command used:
v.in.ogr -o dsn=E:/temp/MSOA_AUG_2004_EW_BGC.shp output=eng_wales_osgb

If I use the '-c' option (dont clean polygons) I dont get the error but this
is no use as it results in some of the polygons going missing.
The shapefile is big but not that big and I can load the shapefile into
Quantum GIS and GMapCreator with no problems so I dont think there is
anything wrong with the shapefiles.
I have tried this with other shapefiles and projections and get a similar
error.
It also seems to be taking a very long time to import - literally hours.
I don't get the error with small shapfiles.
I'm using Windows7 64-bit, GRASS 6.4.0
Output log is pasted below.

Do you think this is an bug or is this not the correct way to import
shapefiles (I'm a GRASS complete beginner)?
Thanks.

The other day Markus Metz has fixed a severe memory leak:
http://trac.osgeo.org/grass/changeset/46444 (GRASS 7)
http://trac.osgeo.org/grass/changeset/46445 (GRASS 6.5)

This has impact on polygons imported with v.in.ogr, so the updated version
may solve your problem. After some testing the fix should go into 6.4, too.

winGRASS binaries with the fix included are available here by *tomorrow*:
http://wingrass.fsv.cvut.cz/grass65/
http://wingrass.fsv.cvut.cz/grass70/

Markus

On Mon, May 30, 2011 at 12:30 PM, Markus Neteler <neteler@osgeo.org> wrote:

On Wed, May 11, 2011 at 4:19 PM, spiderplant0 <spiderplant0@gmail.com> wrote:

Hi, when I try to import a shapefile into GRASS I get this error message:
G_realloc: unable to allocate 18440000 bytes at struct_alloc.c:133

Command used:
v.in.ogr -o dsn=E:/temp/MSOA_AUG_2004_EW_BGC.shp output=eng_wales_osgb

If I use the '-c' option (dont clean polygons) I dont get the error but this
is no use as it results in some of the polygons going missing.
The shapefile is big but not that big and I can load the shapefile into
Quantum GIS and GMapCreator with no problems so I dont think there is
anything wrong with the shapefiles.
I have tried this with other shapefiles and projections and get a similar
error.
It also seems to be taking a very long time to import - literally hours.
I don't get the error with small shapfiles.
I'm using Windows7 64-bit, GRASS 6.4.0
Output log is pasted below.

Do you think this is an bug or is this not the correct way to import
shapefiles (I'm a GRASS complete beginner)?
Thanks.

This fix...

The other day Markus Metz has fixed a severe memory leak:
http://trac.osgeo.org/grass/changeset/46444 (GRASS 7)
http://trac.osgeo.org/grass/changeset/46445 (GRASS 6.5)

This has impact on polygons imported with v.in.ogr, so the updated version
may solve your problem. After some testing the fix should go into 6.4, too.

... is already in GRASS 6.4 as of r46446. I tested (thoroughly) and
submitted to 6.4 because it was a rather serious memory leak.

Markus M