[GraphHopper] [graphhopper android] Error with setting up development

Peter K peathal at yahoo.de
Mon Sep 2 13:31:13 UTC 2013


Yes you can modify the script but I suggest to do:
export JAVA_OPTS="-XX:PermSize=60m -XX:MaxPermSize=60m -Xmx100m -Xms100m
-server"

before you call graphhopper.sh so you won't need to merge upcoming changes.

Looks like your graph is relative big ;) ... world wide graph? To do
that in-memory then 4gb are not enough or you need to use
graph.dataaccess=MMAP (or MMAP_SYNC) at least for the import (see
config.properties)

Also have a look into:
https://github.com/graphhopper/graphhopper/wiki/World-Wide-Road-Network

Regards,
Peter.

> Thanks for your time, Peter.
>
> I've tried again as to your suggestions: remove the node <parent> in
> POM.xml. 
>
> Besides, I digged into some detail about maven and found a way to set
> the network proxy of maven. 
>
> Finally the building went well, until, it ended up with a
> "OutOfMemoryError". 
>
> And the log cat goes like:
>
> ## now building graphhopper jar:
> core/target/graphhopper-0.2-SNAPSHOT-jar-with-dependencies.jar
> ## using maven at ./maven
> ## now import. *JAVA_OPTS=-XX:PermSize=60m -XX:MaxPermSize=60m
> -Xmx1000m -Xms1000m -server*
> 2013-09-02 16:53:05,451 [main] INFO  com.graphhopper.GraphHopper -
> version 0.2|2013-09-02T16:50 (1,2,1,1,1)
> 2013-09-02 16:53:05,458 [main] INFO  com.graphhopper.GraphHopper -
> graph LevelGraphStorage|CAR|RAM_STORE|,,,,, details:edges:0(0),
> nodes:0(0), name: - (0), geo:4(0),
> bounds:1.7976931348623157E308,-1.7976931348623157E308,1.7976931348623157E308,-1.7976931348623157E308
> .....
>
> 2013-09-02 17:04:59,135 [main] INFO  graphhopper.reader.OSMReader -
> 90?000?000, locs:38?998?576 (0) totalMB:966, usedMB:942
>
> 2013-09-02 17:05:15,492 [main] INFO  graphhopper.reader.OSMReader -
> 93?242?889, now parsing ways
>
> *Exception in thread "main" java.lang.OutOfMemoryError: Java heap
> space* - problem when allocating new memory. Old capacity: 78643200,
> new bytes:1048576, segmentSizeIntsPower:18, new segments:1, existing:75
>
>        at
> com.graphhopper.storage.RAMIntDataAccess.ensureCapacity(RAMIntDataAccess.java:136)
>
>        at
> com.graphhopper.storage.GraphStorage.incCapacity(GraphStorage.java:261)
>
>        at
> com.graphhopper.storage.GraphStorage.ensureEdgeIndex(GraphStorage.java:305)
>
>        at
> com.graphhopper.storage.GraphStorage.nextEdge(GraphStorage.java:372)
>
>        at
> com.graphhopper.storage.GraphStorage.internalEdgeAdd(GraphStorage.java:348)
>
>        at
> com.graphhopper.storage.LevelGraphStorage.edge(LevelGraphStorage.java:73)
>
>        at
> com.graphhopper.storage.LevelGraphStorage.edge(LevelGraphStorage.java:34)
>
>        at
> com.graphhopper.reader.OSMReaderHelper.addEdge(OSMReaderHelper.java:283)
>
>        at
> com.graphhopper.reader.OSMReaderHelper.addOSMWay(OSMReaderHelper.java:232)
>
>        at com.graphhopper.reader.OSMReader.processWay(OSMReader.java:301)
>
>        at
> com.graphhopper.reader.OSMReader.writeOsm2Graph(OSMReader.java:191)
>
>        at com.graphhopper.reader.OSMReader.doOSM2Graph(OSMReader.java:79)
>
>        at com.graphhopper.GraphHopper.importOSM(GraphHopper.java:421)
>
>        at com.graphhopper.GraphHopper.importOSM(GraphHopper.java:388)
>
>        at com.graphhopper.GraphHopper.importOrLoad(GraphHopper.java:372)
>
>        at com.graphhopper.GraphHopper.main(GraphHopper.java:56)
>
> According to the logcat, do I have to adjust the parameters for heap
> size of java, in the ./graphhopper.sh?
> (I run the HP in the virtualbox virtual machine with 4GB memory
> allocated.)
>
> Hope we can make it right. Thanks for your help.
>
> Cheers,
>
> 2013/8/31 Peter K <peathal at yahoo.de <mailto:peathal at yahoo.de>>
>
>     I was wrong. A similar thing was already reported:
>     http://lists.openstreetmap.org/pipermail/graphhopper/2013-May/000191.html
>
>     This indicates that you are 'somehow offline' .. some (fire)wall ?
>     But you can just try to remove the <parent>...</parent> entry from
>     the pom.xml in the root folder.
>
>     Regards,
>     Peter.
>
>>     Hi Simon,
>>
>>     this is really strange and wasn't reported before. One thing you
>>     could try is to remove the following two folders:
>>     ~/.m2/repository/org/sonatype
>>     ~/.m2/repository/com/graphhopper
>>
>>     and try to build it again.
>>
>>     Or can you view the following pom in your browser?
>>     http://repo.maven.apache.org/maven2/org/sonatype/oss/oss-parent/7/oss-parent-7.pom
>>
>>     Or can you have a look if the following article helps you (skip
>>     the eclipse section)?
>>     http://java.dzone.com/articles/mavens-non-resolvable-parent
>>
>>     Or this ones here:
>>     https://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
>>
>>     Regards,
>>     Peter.
>>
>>>     Hi Peter,
>>>
>>>     Just run it all over again but errors are stilll there. Here I
>>>     attch a full logcat for your reference. Thanks for your time.
>>>
>>>     *$git clone https://github.com/graphhopper/graphhopper.git* (#I
>>>     modified the protocol from git to https, since my outgoing
>>>     network has a proxy and don't support git.)
>>>     *$./graphhopper.sh import asia_japan.osm*
>>>     ## using java 1.7.0_25 from /opt/jdk1.7.0_25/
>>>     File not found 'asia_japan.osm'. Press ENTER to get it from:
>>>     http://download.geofabrik.de/asia/japan-latest.osm.bz2
>>>     Press CTRL+C if you do not have enough disc space or you don't
>>>     want to download several MB.
>>>
>>>     ## now downloading OSM file from
>>>     http://download.geofabrik.de/asia/japan-latest.osm.bz2 and
>>>     extracting to asia_japan.osm
>>>       HTTP/1.1 200 OK
>>>       Date: Fri, 30 Aug 2013 01:03:55 GMT
>>>       Server: Apache/2.2.22 (Ubuntu)
>>>       Last-Modified: Wed, 28 Aug 2013 18:25:13 GMT
>>>       ETag: "122d-51723097-4e5061c483dc1"
>>>       Accept-Ranges: bytes
>>>       Content-Type: application/x-bzip2
>>>       Content-Length: 1366438039
>>>       Connection: close
>>>     2013-08-30 11:24:22
>>>     URL:http://download.geofabrik.de/asia/japan-latest.osm.bz2
>>>     [1366438039/1366438039] -> "-" [1]
>>>     *./graphhopper.sh: line 65: mvn: command not found*
>>>     *No Maven found in the PATH. Now downloading+installing it to
>>>     ./maven*
>>>     --2013-08-30 11:24:22--
>>>      http://www.eu.apache.org/dist/maven/maven-3/3.0.5/binaries/apache-maven-3.0.5-bin.zip
>>>     Length: 5870668 (5.6M) [application/zip]
>>>     Saving to: `maven.zip'
>>>
>>>     100%[======================================>] 5,870,668  
>>>      244K/s   in 27s     
>>>
>>>     2013-08-30 11:24:50 (213 KB/s) - `maven.zip' saved [5870668/5870668]
>>>
>>>     *Archive:  maven.zip*
>>>     *   creating: apache-maven-3.0.5/*
>>>       inflating: apache-maven-3.0.5/LICENSE.txt  
>>>       inflating: apache-maven-3.0.5/NOTICE.txt  
>>>       inflating: apache-maven-3.0.5/README.txt  
>>>        creating: apache-maven-3.0.5/bin/
>>>       inflating: apache-maven-3.0.5/bin/m2.conf  
>>>       inflating: apache-maven-3.0.5/bin/mvn.bat  
>>>       inflating: apache-maven-3.0.5/bin/mvnDebug.bat  
>>>       inflating: apache-maven-3.0.5/bin/mvn  
>>>       inflating: apache-maven-3.0.5/bin/mvnDebug  
>>>       inflating: apache-maven-3.0.5/bin/mvnyjp  
>>>        creating: apache-maven-3.0.5/conf/
>>>       inflating: apache-maven-3.0.5/conf/settings.xml  
>>>        creating: apache-maven-3.0.5/lib/
>>>        creating: apache-maven-3.0.5/lib/ext/
>>>       inflating: apache-maven-3.0.5/lib/ext/README.txt  
>>>        creating: apache-maven-3.0.5/boot/
>>>      extracting: apache-maven-3.0.5/boot/plexus-classworlds-2.4.jar  
>>>      ...(#extrcting more lib here)  
>>>     ## *now building graphhopper jar:
>>>     core/target/graphhopper-0.2-SNAPSHOT-jar-with-dependencies.jar*
>>>     ## using maven at ./maven
>>>     ## compilation failed
>>>     [INFO] Scanning for projects...
>>>     *Downloading:
>>>     http://repo.maven.apache.org/maven2/org/sonatype/oss/oss-parent/7/oss-parent-7.pom*
>>>     [ERROR] The build could not read 1 project -> [Help 1]
>>>     [ERROR]   
>>>     [ERROR]   The project com.graphhopper:graphhopper:0.2-SNAPSHOT
>>>     (/opt/simonlab/graphhopper/./core/pom.xml) has 1 error
>>>     [ERROR]     Non-resolvable parent POM for
>>>     com.graphhopper:graphhopper-parent:0.2-SNAPSHOT: Could not
>>>     transfer artifact org.sonatype.oss:oss-parent:pom:7 from/to
>>>     central (http://repo.maven.apache.org/maven2):
>>>     repo.maven.apache.org <http://repo.maven.apache.org>: Name or
>>>     service not known and 'parent.relativePath' points at wrong
>>>     local POM @ com.graphhopper:graphhopper-parent:0.2-SNAPSHOT,
>>>     /opt/simonlab/graphhopper/pom.xml, line 16, column 13: Unknown
>>>     host repo.maven.apache.org <http://repo.maven.apache.org>: Name
>>>     or service not known -> [Help 2]
>>>     [ERROR] 
>>>     [ERROR] To see the full stack trace of the errors, re-run Maven
>>>     with the -e switch.
>>>     [ERROR] Re-run Maven using the -X switch to enable full debug
>>>     logging.
>>>     [ERROR] 
>>>     [ERROR] For more information about the errors and possible
>>>     solutions, please read the following articles:
>>>     [ERROR] [Help 1]
>>>     http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
>>>     [ERROR] [Help 2]
>>>     http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
>>>
>>>     I can't open 'repo.maven.apache.org
>>>     <http://repo.maven.apache.org>' in my browser because it seems
>>>     that browsing is disabled. And it suggest view
>>>     http://search.maven.org instead. No problem with
>>>     search.maven.org <http://search.maven.org> here.
>>>
>>>     Any suggestions?
>>>
>>>     Thanks.
>>>
>>>
>>>     2013/8/29 Peter K <peathal at yahoo.de <mailto:peathal at yahoo.de>>
>>>
>>>         Hi Simon,
>>>
>>>         which maven version are you using? I've now tried it with a
>>>         clean maven repository to really ensure it works for new users.
>>>
>>>         Could you try just again? Probalbly just the maven central
>>>         or sonatype repo was down (?)
>>>
>>>         Regards,
>>>         Peter.
>>>
>>>>         Hi there,
>>>>
>>>>         I'm planning to using graphhopper to do a demo android app
>>>>         for map view and started out yesterday with the wiki.
>>>>
>>>>         Unlucky me, I got stuck with some errors when following the
>>>>         instructions. Hope you guys can help me out of this.
>>>>
>>>>         Here is the thing:
>>>>         OS - Ubuntu 12.04
>>>>         HardDrive - 40G
>>>>         RAM - 2G
>>>>         Eclipse - ADT Bundle (from Google Android developers site) 
>>>>         Steps:
>>>>         1.$ git clone git://github.com/graphhopper/graphhopper.git
>>>>         <http://github.com/graphhopper/graphhopper.git> graphhopper
>>>>         2.$ cd graphhopper
>>>>         3.download map data of japan manually from
>>>>         download.geofabric.de <http://download.geofabric.de> and
>>>>         extract it to a .osm file
>>>>         4.$ ./graphhopper.sh import japan-latest.osm 
>>>>         ## using java 1.7.0_25 from /opt/jdk1.7.0_25/
>>>>         ## using existing osm file japan-latest.osm
>>>>         ./graphhopper.sh: line 65: mvn: command not found
>>>>         ## now building graphhopper jar:
>>>>         core/target/graphhopper-0.2-SNAPSHOT-jar-with-dependencies.jar
>>>>         ## using maven at ./maven
>>>>         ## compilation failed
>>>>         [INFO] Scanning for projects...
>>>>         Downloading:
>>>>         http://repo.maven.apache.org/maven2/org/sonatype/oss/oss-parent/7/oss-parent-7.pom
>>>>         [ERROR] The build could not read 1 project -> [Help 1]
>>>>         [ERROR]   
>>>>         [ERROR]   The project
>>>>         com.graphhopper:graphhopper:0.2-SNAPSHOT
>>>>         (/opt/simonlab/graphhopper/./core/pom.xml) has 1 error
>>>>         [ERROR]     Non-resolvable parent POM for
>>>>         com.graphhopper:graphhopper-parent:0.2-SNAPSHOT: Could not
>>>>         transfer artifact org.sonatype.oss:oss-parent:pom:7 from/to
>>>>         central (http://repo.maven.apache.org/maven2):
>>>>         repo.maven.apache.org <http://repo.maven.apache.org>: Name
>>>>         or service not known and 'parent.relativePath' points at
>>>>         wrong local POM @
>>>>         com.graphhopper:graphhopper-parent:0.2-SNAPSHOT,
>>>>         /opt/simonlab/graphhopper/pom.xml, line 16, column 13:
>>>>         Unknown host repo.maven.apache.org
>>>>         <http://repo.maven.apache.org>: Name or service not known
>>>>         -> [Help 2]
>>>>         [ERROR] 
>>>>         [ERROR] To see the full stack trace of the errors, re-run
>>>>         Maven with the -e switch.
>>>>         [ERROR] Re-run Maven using the -X switch to enable full
>>>>         debug logging.
>>>>         [ERROR] 
>>>>         [ERROR] For more information about the errors and possible
>>>>         solutions, please read the following articles:
>>>>         [ERROR] [Help 1]
>>>>         http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
>>>>         [ERROR] [Help 2]
>>>>         http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
>>>>
>>>>         Any tips or hints to shed on this?
>>>>
>>>>         Thanks!
>>>>
>>>>         Cheers,
>>>>         -- 
>>>>         Simon gong
>>>>         Enjoy Work, Enjoy Life
>>>>
>>>>
>>>>         _______________________________________________
>>>>         GraphHopper mailing list
>>>>         GraphHopper at openstreetmap.org <mailto:GraphHopper at openstreetmap.org>
>>>>         http://lists.openstreetmap.org/listinfo/graphhopper
>>>
>>>
>>>         _______________________________________________
>>>         GraphHopper mailing list
>>>         GraphHopper at openstreetmap.org
>>>         <mailto:GraphHopper at openstreetmap.org>
>>>         http://lists.openstreetmap.org/listinfo/graphhopper
>>>
>>>
>>>     Cheers,
>>>
>>>     -- 
>>>     Simon Gong
>>>     Enjoy Work, Enjoy Life
>>
>>
>>
>>     _______________________________________________
>>     GraphHopper mailing list
>>     GraphHopper at openstreetmap.org <mailto:GraphHopper at openstreetmap.org>
>>     http://lists.openstreetmap.org/listinfo/graphhopper
>
>
>     _______________________________________________
>     GraphHopper mailing list
>     GraphHopper at openstreetmap.org <mailto:GraphHopper at openstreetmap.org>
>     http://lists.openstreetmap.org/listinfo/graphhopper
>
>
>
>
> -- 
> Simon Gong
> Enjoy Work, Enjoy Life
>
>
> _______________________________________________
> GraphHopper mailing list
> GraphHopper at openstreetmap.org
> http://lists.openstreetmap.org/listinfo/graphhopper

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/graphhopper/attachments/20130902/67394e56/attachment.html>


More information about the GraphHopper mailing list