I have seen that link also, and have tried using --cache-strategy sparse and --cache-strategy dense but I get the same problem.
The build of osm2pgsql I’m using has been compiled for 64-bit id space, but it won’t let me specify more than about 1400MB for the cache.
And I’m getting the response of “out of memory for sparse node cache” before it starts attempting any processing, like it’s checking my RAM but not finding enough even though there’s >60GB free.
I’m needing to import using a Windows version of osm2pgsql as this is the nature of the server it’s running on. I’ve not tried using a Linux build, but might install it on an external drive and try it out on the same PC.
It works for me on 32-bit Windows and usage is simple, just go to the installation directory and run. The command I use is
osm2pgsql -H localhost -P 5432 -d db_name -p osm -U username -W -s -S c:\osm2pgsql_2012\default.style -k -G -r pbf --create --unlogged --cache-strategy sparse --cache 600 finland-latest.osm.pbf
Hi JRA, thanks for your reply. I will try this and report back.
I am able to import small(ish) amounts of data, like Germany and U.K, but not Europe or Planet.
Have you solve your problem verfum? And can you tell me you imporint speed of the osm2pgsql?
My server’s RAM is 20GB and the shared_buffer and other parameters were congfigured. So the cache size is enough, but the speed was too slow:(
Can you tell me what I can do to deal with it?
With much thanks!