[GIS] Nominatim installation error: Out of memory for node cache dense index

nominatimopenstreetmaposm2pgsqlosmosispostgresql

I am installing Nominatim on my Ubuntu server 14.04 through this link and trying to load OSM data into my postgreSQL database. For loading into my database I am using this command as given in the link:

~/Nominatim/utils/setup.php   --osm-file data/latest.osm.pbf   --all --osm2pgsql-cache 1024 2>&1   | tee setup.log 

But it is throwing an error

Using projection SRS 4326 (Latlong)
NOTICE:  table "place" does not exist, skipping
NOTICE:  type "keyvalue" does not exist, skipping
NOTICE:  type "wordscore" does not exist, skipping
NOTICE:  type "stringlanguagetype" does not exist, skipping
NOTICE:  type "keyvaluetype" does not exist, skipping
NOTICE:  function get_connected_ways(pg_catalog.int4[]) does not exist,  skipping
Allocating memory for dense node cache
Out of memory for node cache dense index, try using "--cache-strategy  sparse" instead
Error occurred, cleaning up
ERROR: Error executing external command: /home/nominatim/Nominatim /osm2pgsql/osm2pgsql -lsc -O gazetteer --hstore -C 256 -P 5432 -d nominatim /home/nominatim/data/latest.osm.pbf
Error executing external command: /home/nominatim/Nominatim/osm2pgsql/osm2pgsql -lsc -O gazetteer --hstore -C 256 -P 5432 -d nominatim /home/nominatim/data/latest.osm.pbf

My ubuntu has 7GB of RAM and I am not sure why this error is coming. I ran the above command by reducing the cache size to 512 and then 256 but it is running into same error. I am not sure how to use --cache-strategy sparse in the given command.

Screenshot of my Error:
enter image description here

Could anybody help with the setup?

Best Answer

I have resolved this issue.

Go through this link and follow all the instructions posted there.

Problem Resolved