btittelbach/openmtbmap_openvelomap_linux

Could not create the Java virtual machine

dncgst opened this issue · 2 comments

Hi Bernhard,

I tried to use the script as follow:
./create_omtb_garmin_img.sh openmtbmap.org/germany/mtbgermany.exe thin /usr/local/share/mkgmap/mkgmap.jar

but I get a syntax error:
./create_omtb_garmin_img.sh: line 6: syntax error near unexpected token newline' ./create_omtb_garmin_img.sh: line 6:'

Thanks a lot!

Hi Bernhard,
I'm sorry. I made a mistake downloading the script... So I solved my first comment, but now that a run the right script I get a VM error:

Extracting openmtbmap.org/germany/mtbgermany.exe ...
Using display-TYP-file: /home/dncgst/Downloads/openmtbmap.org/germany/OMTB_tmp/thinde.TYP
Using FID 6371
gmt v0.8.186.801b CC BY-SA (C) 2011-2014 AP www.gmaptool.eu

TYP correction: file 01002468.TYP, FID 6371, PID 1, CP 1252
Using mkgmap, building address search index...
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.

Is it a problem of my machine?
Thanks a lot!

yes and no...
using mkgmap to build the search index can take lot's of memory.
Thus my script instructs java to allocate 3GiB of RAM for that, which is the minimum value that worked for all maps I've tested so far. Obviously your system doesn't have that much free memory left, so java can't start.
The map you're downloading however certainly won't need 3Gigs of RAM, so just change the option
"java -Xmx3000M" to a smaller value like "java -Xmx1000M" or remove the "-Xmx3000M" alltogether.

That should make it work