Opened 13 years ago

Closed 13 years ago

Last modified 13 months ago

#1436 closed defect (fixed)

shp2pgsql memory leakage

Reported by: strk Owned by: strk
Priority: medium Milestone: PostGIS 2.0.0
Component: utils/shp2pgsql Version: master
Keywords: Cc:

Description

3 megabytes lost during loading of GSHHS data:

==20958==    definitely lost: 3,468,357 bytes in 200,647 blocks

Data is here:

http://www.ngdc.noaa.gov/mgg/shorelines/data/gshhs/version2.2.0/GSHHS_shp_2.2.0.zip

The call:

./shp2pgsql -s 4326 -g geom -G -I ~/Desktop/GSHHS_shp/i/GSHHS_i_L1.shp coast1

Change History (4)

comment:1 by strk, 13 years ago

It is the UTF8 conversion leaking:

==21046== HEAP SUMMARY:
==21046==     in use at exit: 3,468,357 bytes in 200,647 blocks
==21046==   total heap usage: 1,840,844 allocs, 1,640,197 frees, 6,746,422,052 bytes allocated
==21046== 
==21046== 6 bytes in 1 blocks are definitely lost in loss record 1 of 2
==21046==    at 0x4C274A8: malloc (vg_replace_malloc.c:236)
==21046==    by 0x4097A1: set_loader_config_defaults (shp2pgsql-core.c:763)
==21046==    by 0x40BAA5: main (shp2pgsql-cli.c:86)
==21046== 
==21046== 3,468,351 bytes in 200,646 blocks are definitely lost in loss record 2 of 2
==21046==    at 0x4C274A8: malloc (vg_replace_malloc.c:236)
==21046==    by 0x409FCD: utf8 (shp2pgsql-core.c:93)
==21046==    by 0x40A45D: ShpLoaderGenerateSQLRowStatement (shp2pgsql-core.c:1558)
==21046==    by 0x40BF63: main (shp2pgsql-cli.c:346)
==21046== 
==21046== LEAK SUMMARY:
==21046==    definitely lost: 3,468,357 bytes in 200,647 blocks
==21046==    indirectly lost: 0 bytes in 0 blocks
==21046==      possibly lost: 0 bytes in 0 blocks
==21046==    still reachable: 0 bytes in 0 blocks
==21046==         suppressed: 0 bytes in 0 blocks

comment:2 by strk, 13 years ago

Owner: changed from mcayland to strk
Status: newassigned

comment:3 by strk, 13 years ago

Resolution: fixed
Status: assignedclosed

Fixed with r8709

comment:4 by strk, 13 months ago

Component: utils/shapefile-loader-dumperutils/shp2pgsql
Note: See TracTickets for help on using tickets.