Discussion:
[mkgmap-dev] mkgmap gives java error
Tony Groves
2010-03-13 19:26:09 UTC
Permalink
Hello!

I got my first GPS recently, a Garmin GPSmap 60CSx, and am now trying
to create maps for it via mkgmap, but am having problems. I'm running
Debian Lenny, with mkgmap-r1600 (current version) and Sun Java 6. My
machine is 32-bit AMD with 2GB memory.

I managed OK (using an older mkgmap version) to convert and upload a few
small city maps (Dublin, Barcelona, etc.) but can't manage (using either
mkgmap version) a bigger map, all of Ireland, which I got from Geofabrik
(http://download.geofabrik.de/osm/). The .osm file is 318MB in size.
When I run mkgmap (with no options) I get an error, which starts as
follows:

java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOfRange(Arrays.java:3209)
at java.lang.String.<init>(String.java:216)
at
com.sun.org.apache.xerces.internal.xni.XMLString.toString(XMLString.java:185)
at
com.sun.org.apache.xerces.internal.util.XMLAttributesImpl.getValue(XMLAttributesImpl.java:537)
at
com.sun.org.apache.xerces.internal.xinclude.XIncludeHandler.processAttributes(XIncludeHandler.java:2030)
at
com.sun.org.apache.xerces.internal.xinclude.XIncludeHandler.startElement(XIncludeHandler.java:907)
at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400)

I then used splitter (current version) to split the map file, which
resulted in a single file being produced, 142MB after unpacking (less
than half the size of the original!?), and submitted that to mkgmap,
but it bombed out again (though with a different error).

Can anybody suggest what I might need to do to get it working?

Thanks very much.

Tony.
Clinton Gladstone
2010-03-13 19:34:37 UTC
Permalink
Post by Tony Groves
java.lang.OutOfMemoryError: Java heap space
This generally means that you need to allocate more memory to Java. Try something like the following:

java -Xmx2048M -jar ...

Cheers.
Mark Burton
2010-03-13 19:34:45 UTC
Permalink
Hello Tony,
Post by Tony Groves
I got my first GPS recently, a Garmin GPSmap 60CSx, and am now trying
to create maps for it via mkgmap, but am having problems. I'm running
Debian Lenny, with mkgmap-r1600 (current version) and Sun Java 6. My
machine is 32-bit AMD with 2GB memory.
I managed OK (using an older mkgmap version) to convert and upload a few
small city maps (Dublin, Barcelona, etc.) but can't manage (using either
mkgmap version) a bigger map, all of Ireland, which I got from Geofabrik
(http://download.geofabrik.de/osm/). The .osm file is 318MB in size.
When I run mkgmap (with no options) I get an error, which starts as
java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOfRange(Arrays.java:3209)
at java.lang.String.<init>(String.java:216)
at
com.sun.org.apache.xerces.internal.xni.XMLString.toString(XMLString.java:185)
at
com.sun.org.apache.xerces.internal.util.XMLAttributesImpl.getValue(XMLAttributesImpl.java:537)
at
com.sun.org.apache.xerces.internal.xinclude.XIncludeHandler.processAttributes(XIncludeHandler.java:2030)
at
com.sun.org.apache.xerces.internal.xinclude.XIncludeHandler.startElement(XIncludeHandler.java:907)
at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400)
I then used splitter (current version) to split the map file, which
resulted in a single file being produced, 142MB after unpacking (less
than half the size of the original!?), and submitted that to mkgmap,
but it bombed out again (though with a different error).
Can anybody suggest what I might need to do to get it working?
Sounds like you need to specify a suitable value for the splitter's
--max-nodes option so that it creates multiple output files rather than
just one (i.e. it really does split the map!) I prefer small tiles so I
normally use --max-nodes=600000

Mark
Tony Groves
2010-03-13 22:41:31 UTC
Permalink
Post by Clinton Gladstone
java -Xmx2048M -jar ...
That works now, thanks!
Post by Clinton Gladstone
Sounds like you need to specify a suitable value for the splitter's
--max-nodes option so that it creates multiple output files rather than
just one (i.e. it really does split the map!) I prefer small tiles so I
normally use --max-nodes=600000
That works fine, thanks!


Tony.

Loading...