osm2pgsql Processing: Node(nK) Way(0k) Relation(0)Error allocating nodes Error occurred, cleaning up


I was trying to import OSM data to my PostgreSQL database and I got this error

This error usually occur when system runs out of RAM, there can be other reasons too but in my case this was the reason.

The command that I ran is given below

You can add you experiences by leaving your comments so that others could be helped

When I got this error then I decided well lets see what osm2pgsql.exe have in store

so I ran this command

below is the output for the command

Out of all the options, the particular one for my interest what -s which is called the slim mode (I was lucky that I didn’t have to install another 4GB of RAM on my system). You can read through what it does above.

So I reran my command as below

Now the process of importing data to your database will be really slow but that’s Ok I guess if it ends up saving you $s but if time is important then spend some money on RAM and you should be Ok to process OSM files faster.

I hope this helps


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.