Hi,
When loading a large PBF file (us-latest.osm.pbf) I am unable to get Graphhopper to process the file and create the “-gh” directory when turn costs are enabled. Instead I receive an Out Of Memory error after 50 minutes citing the Java heap space. This happens no matter how much memory I have tried throwing at it (up to 30G). If I disable turn costs then the processing succeeds with a modest amount of memory (<10G).
Some details:
Graphhopper Version: 2.1
Java Options: -Xmx30G
Data Access: MMAP_STORE
CH: Enabled for “car”
LM: Disabled
Error Message:
Exception in thread "main" java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Java heap space at com.graphhopper.routing.ch.CHPreparationHandler.prepare(CHPreparationHandler.java:207) at com.graphhopper.GraphHopper.prepareCH(GraphHopper.java:1081) at com.graphhopper.GraphHopper.postProcessing(GraphHopper.java:952) at com.graphhopper.GraphHopper.process(GraphHopper.java:665) at com.graphhopper.GraphHopper.importOrLoad(GraphHopper.java:628) ... Caused by: java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Java heap space at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122) at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191) at com.graphhopper.routing.ch.CHPreparationHandler.prepare(CHPreparationHandler.java:203) ... 7 more Caused by: java.lang.OutOfMemoryError: Java heap space at com.graphhopper.routing.ch.EdgeBasedWitnessPathSearcher.initStorage(EdgeBasedWitnessPathSearcher.java:329) at com.graphhopper.routing.ch.EdgeBasedWitnessPathSearcher.<init>(EdgeBasedWitnessPathSearcher.java:112) at com.graphhopper.routing.ch.EdgeBasedNodeContractor.initFromGraph(EdgeBasedNodeContractor.java:100) at com.graphhopper.routing.ch.PrepareContractionHierarchies.initFromGraph(PrepareContractionHierarchies.java:186) at com.graphhopper.routing.ch.PrepareContractionHierarchies.doSpecificWork(PrepareContractionHierarchies.java:128) at com.graphhopper.routing.util.AbstractAlgoPreparation.doWork(AbstractAlgoPreparation.java:30) at com.graphhopper.routing.ch.CHPreparationHandler.lambda$prepare$0(CHPreparationHandler.java:191) at com.graphhopper.routing.ch.CHPreparationHandler$$Lambda$36/0x0000000840103040.run(Unknown Source)
I guess my questions are (1) Is this expected, and (2) is there a way to work around this high memory requirement during the initial processing of a PBF file with turn costs (and CH) enabled?
I have been battling with this for a while now so any help would be appreciated.