0

I am attempting to import OSM road data using an SQL file generated by OSM2PO. However I keep getting the following error:

ERROR: out of memory
SQL state: 53200
Detail: Failed on request of size 1048576.

This would suggest there is some memory limit set in the config file to only 1MB. However, I have set my work_mem to 16MB and my shared_mem to 500MB in the config file and reloaded it, plus completely restarted the server. I have also tried manually setting the work_mem for the session.

The really annoying thing is that I have used this process to import a much larger dataset into PostGIS on a Netbook computer with considerably less physical memory. I vaguely remember having to tweak some setting to do it but for the life of me I can't remember what it was and the config file looks like the original factory settings!

So, if it is not the work_mem that is at fault, which setting should I adjust? (I'm using PostGIS 2 and Postgresql 9.1 on Windows 7 32 bit).

Many thanks!

1 Answer 1

4

Just an assumption:

osm2po builds blocks of 25 data rows per insert for performance reasons and to avoid memory issues. Do you import it in one single Transaction (parameter -1 or --single-transaction)?

3
  • I just loaded the SQL into pgAdmin and pressed 'Go', so I guess that counts as a single transaction. My inference from your comment its that I should do it from the command line as multiple transactions. Commented Sep 16, 2012 at 7:20
  • This is the reason. You had better used the psql commandline tool.
    – Carsten
    Commented Sep 16, 2012 at 7:21
  • Just did (well, psql from cmd actually) and it was mind-blowingly fast! Job done. Thanks. Commented Sep 16, 2012 at 7:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.