NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum


I know this has been posted many times, but no answer posted has been able to fix my problem.

I'm trying to import planet-latest.osm (planet Open Street Map)

I tried using the following command:

osm2pgsql -c -S /usr/share/osm2pgsql/ --slim -d osm --flat-nodes /var/tmp/flat-nodes.bin --number-processes 8 -C 25000 planet-latest.osm

At the begining, it failed because my node cache wasn't high enough. After I increased it, I've read it was getting killed because I needed 40G ram without --slim, so I used slim. Then I've read it was killed because I needed --flat-nodes with --slim, so I used --flat-nodes. I can't find what I am doing wrong. I'm sure it is obvious for some of you what I am doing wrong. If you can help me, I would realy appreciate it. Thanks!

PS: I'm running on Ubuntu VM using 32G Ram VM has approx 1000G space available using 8 process

I get the message: Reading in file: planet-latest.osm Processing: Node(2418060k 86.4k/s) Way(0k 0.00k/s) Relation(0 0.00/s)Killed

And then I get back into command line.

asked 24 Apr '15, 13:41

Qalisto's gravatar image

accept rate: 0%


Check dmesg for a message containing Out of memory and/or oomkiller. If this message appears then you will need to add more ram or more swap, the latter being significantly slower.

(24 Apr '15, 13:58) scai ♦

... and (just in case you haven't already done this) I'd definitely run the process all the way through on a smaller extract first - and obviously if you don't have a need to render the whole planet, it makes sense to use a smaller extract anyway.

(24 Apr '15, 14:12) SomeoneElse ♦

As scai has pointed out you are likely running out of memory, you will need to add swap (which while slower is still preferrable to any other solution). Further I would suggest not running with 8 threads which, given the size of your machine, is likely to be counter productive.

permanent link

answered 26 Apr '15, 10:16

SimonPoole's gravatar image

SimonPoole ♦
accept rate: 18%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 24 Apr '15, 13:41

question was seen: 3,458 times

last updated: 26 Apr '15, 10:16

NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum