<p>I am setting up a PostGIS enabled PostGreSQL database for the entire planet.osm file. I am using WIndows 2008 R2 64-bit. When I run the osm2pgsql code attached in the file <a href="https://github.com/openstreetmap/osm2pgsql/files/40505/load_osm_data.txt">load_osm_data.txt</a>, I get an error as follows:</p>
<pre><code>Allocating memory for sparse node cache
Out of memory for sparse node cache, reduce --cache size
</code></pre>
<p>The complete console input and output can be found in the following file: <br>
<a href="https://github.com/openstreetmap/osm2pgsql/files/40502/osm2pgsql_cygwin_console.txt">osm2pgsql_cygwin_console.txt</a><br>
(Note: I was unable to run the code as a .sh file from the console, so I just copied and pasted the contents into the console.)</p>
<p>As indicated at the top of the cygwin_console.txt, I have over 14000 MB of available memory, but when trying to allocate under 10600 MB, I get the out of memory error. I am able to get the script to work if I use 1440 MB or less for the cache, but this will take too long. I have also tried to hard code in 10000 MB for the cache size in case my code was outputting weird data to the osm2pgsql command, but still got the same out of memory error.</p>
<p>Any ideas as to why I cannot allocate more of the available memory to the osm2pgsql.exe process?</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/openstreetmap/osm2pgsql/issues/508">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AD2-7tCHTiwGJnVKJanqcACqwCIHx_O4ks5pH4YtgaJpZM4GmstR.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
<link itemprop="url" href="https://github.com/openstreetmap/osm2pgsql/issues/508"></link>
<meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>