Opened 16 years ago
Last modified 16 years ago
#106 closed task (fixed)
pgsql2shp memory leak on WIndows
Reported by: | krellor | Owned by: | robe |
---|---|---|---|
Priority: | medium | Milestone: | |
Component: | postgis | Version: | |
Keywords: | Cc: |
Description
What steps will reproduce the problem?
- Export NHD table to shp file using pgsql2shp.exe
What is the expected output? What do you see instead?
After 3.1 million records exported the process fails giving a generic fwrite() error. The expected output is a shp file.
What version of the product are you using? On what operating system?
1.3.5 on 32bit Windows XP pro, and 32bit Windows Vista Business
Please provide any additional information below.
I have a table that holds the flowline hydrography of Washington State. When I export to shapefile on Windows XP the processes memory usage swells to 1.6GB and then fails with a generic fwrite() error. When I attach my debugger to the running process I see a Heap Coruption error for every single row exported. I've looked at the source but don't see anything that stands out as an error. I tried re-building with cygwin changing it to be more verbose, but ran into some problems.
On Windows Vista Business windows terminates the process on the first row, presumably because it has stricter memory management than Windows XP, which only fails when the system is out of memory. On Windows XP I tried breaking up the 4 million records across 4 tables, 1 million records each.
I was able to successfully export them that way so I know it is not a
problem with the data. And like I said, every single row exported throws a Heap Corruption error.
Change History (4)
comment:1 by , 16 years ago
comment:2 by , 16 years ago
I have downloaded your compiled exe and will try again this evening and see if it still throwing heap corruptions or not. I will also test the projection file and make sure it reads properly.
comment:3 by , 16 years ago
Ok, I tested it and it seems to work. Also, the prj file worked fine for me.
Krellor,
Can you try the 1.3.6SVN build. I had fixed the Windows Vista crash problem in that version, though your other issue probably still exists in that version, though maybe not because the main change in 1.3.6 was changing how we release memory.
If you need a windows precompiled version — I have one here which is from December but should be good enough.
http://www.bostongis.com/downloads/pgutils/pgsql2shp136patched.zip
Alas another victim. If you have a non -1 SRID, can you verify that it also outputs a .prj file and if you have something like ArcGIS or some other .prj aware app, that it reads it correctly. Works for me, but haven't gotten anyone else to verify.
Thanks, Regina