I can now definitively answer my question: yes!, you can load the whole of Europe :slight_smile: - and thus likely the entire planet - on a minimalistic 12GB RAM virtualbox VM.

In order to finally succeed though, I had to overcome two more crashes. Both were likely caused by the fact I used two osm2pgsql settings that, unless you have the resources, are probably best left to osm2pgsql: the ā€œ-Cā€ cache option, and ā€œā€“number_processesā€. Once I removed both of these from my command line statements, osm2pgsql happily chugged along and imported the data without issue.

So, what did I learn from all of this?:

  • Yes, it is possible to load the Geofabrik Europe extract (and likely planet as well as it is just about 2-3 times bigger) on a low RAM device.
  • It is vital to use the ā€œā€“flat-nodesā€ option to not run out of RAM and instead use disk space to store the nodes (cache). You cannot process this amount of data (Europe) in memory. So ignore warnings that are listed on some web pages that ā€œā€“flat-nodesā€ should only be used ā€œfor the whole planetā€: if you don’t have the RAM, use ā€œā€“flat-nodesā€, it is your only option anyway without enough RAM.
  • Don’t try to be smart like I did by setting the ā€œ-Cā€ cache option or ā€œā€“number_processesā€ parameters, instead, leave it to osm2pgsql to figure out its optimal processing settings, it seems to do a reasonable job!
1 Like