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


I am trying to import a large area from europe.osm. To do that I executed the following command:

"C:\Program Files (x86)\osmosis\bin\osmosis.bat" --read-xml file="G:\Restricted\Radu\Facultate\2012-2013\Licenta\europe.osm" --bounding-box left=12.04 top=55.44 right=30.19 bottom=43.51 --write-pgsql host="localhost" database="eastern_europe" user="postgres" password="parola"

After almost a day of executing the following error dropped:
OutOfMemmory: Java heap space

From what I've seen on a quick fix for this error is to set JAVACMD_OPTIONS to change the amount of memmory allocated (JAVACMD_OPTIONS=-Xmx2G will allocate 2 GB).

First of all I would like to know where do I have to set JAVACMD_OPTIONS. I am a Windows user. Do I have to edit osmosis.bat in bin directory?

Also setting JAVACMD_OPTIONS to 2GB will be enough for osmosis to not crush again or do I have to set other variables? I want to be sure before executing the process again because I have to wait almost a day to see any results and I will loose a lot of time if it crashes again.

Thank you

asked 18 Apr '13, 10:33

raduzugravu's gravatar image

accept rate: 0%

edited 21 Apr '13, 08:38

Are you running a 32-bit or 64-bit version of Java? You're running a 64-bit version of Windows (you're running osmosis.bat out of "Program Files (x86)") but we don't know which Java you're running.

(18 Apr '13, 10:37) SomeoneElse ♦

It seems I am running a 32-bit JVM. The command: "java -d64 -version" returned: "This instance does not support a 64-bit JVM".

(18 Apr '13, 10:40) raduzugravu

Do I have to install the 64-bit version?

(18 Apr '13, 22:24) raduzugravu

Try typing at the command line that you're going to run osmosis, "set JAVACMD_OPTIONS=-server -Xmx2G"

permanent link

answered 11 May '15, 00:42

Heshy's gravatar image

accept rate: 0%

edited 11 May '15, 00:51

SET EXEC="%JAVACMD%" %JAVACMD_OPTIONS% -cp "%PLEXUS_CP%" -Dapp.home="%MYAPP_HOME%" -Dclassworlds.conf="%MYAPP_HOME%\config\plexus.conf" %MAINCLASS% %OSMOSIS_OPTIONS% %*

As per osmosis.bat file , set java options in the bat file like any other parameter with set xxxx=value

permanent link

answered 06 Jun '16, 20:47

rajashekar's gravatar image

accept rate: 0%

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: 18 Apr '13, 10:33

question was seen: 7,850 times

last updated: 06 Jun '16, 20:47

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