I’m experiencing an issue when running GraphHopper 11.0 on a Windows-based VM.
When I try to import italy-latest.osm.pbf, the process consistently stops at this log line:
“com.graphhopper.reader.osm.WaySegmentParser - pass2 - start reading OSM ways”
No errors are thrown, it just freezes there indefinitely. What’s strange is:
On my local PC, the graph is created successfully in ~13 minutes.
On the VM, it stops at that exact log line after just a couple of minutes, and doesn’t continue.
The .pbf file is the exact same file (SHA256 verified).
Java version, GraphHopper version, and configuration are identical.
I tried limiting RAM (e.g. -Xmx1024m) and even corrupting the .pbf for testing, but those scenarios behave differently. They don’t match the specific freeze behavior.
I’ve also verified:
It’s not a file permission issue.
The .pbf is not served via network or HTTP in this test; it’s on the local file system.
I even tried creating the graph locally and moving the graph-cache folder to the VM, which works fine.
So, I have a working workaround, but I’d like to understand what’s happening and whether there’s something in WaySegmentParser or the VM environment that could explain this.
Any insight would be much appreciated—especially from anyone who’s seen a similar freeze at this stage.
We tried to build the national road graph before running the application on VM again, but it continues to cause problems after testing. I kindly ask if anyone more experienced is able to understand what the log file says exactly and what the problem is.
This is the log:
2025-07-30 16:47:14.798 [main] INFO i.d.core.server.DefaultServerFactory - Registering jersey handler with root path prefix: /
2025-07-30 16:47:14.819 [main] INFO i.d.core.server.DefaultServerFactory - Registering admin handler with root path prefix: /
2025-07-30 16:47:15.569 [main] INFO io.dropwizard.assets.AssetsBundle - Registering AssetBundle with name: assets for path /maps/*
2025-07-30 16:47:15.569 [main] INFO io.dropwizard.assets.AssetsBundle - Registering AssetBundle with name: webjars for path /webjars/*
2025-07-30 16:47:15.584 [main] INFO i.d.core.server.ServerFactory - Starting GraphHopperApplication
_ _
__ _ _ __ __ _ _ __ | |__ | |__ ___ _ __ _ __ ___ _ __
/ | '__/ _ | ’ | '_ | '_ \ / _ | '_ | '_ \ / _ \ '|
| (| | | | (| | |) | | | | | | | () | |) | |) | / |
_, || _,| ./|| ||| ||_/| ./| ./ _||
|/ || || |_|
2025-07-30 16:47:15.756 [main] INFO o.e.jetty.setuid.SetUIDListener - Opened application@701bc94e{HTTP/1.1, (http/1.1)}{localhost:8989}
2025-07-30 16:47:15.756 [main] INFO o.e.jetty.setuid.SetUIDListener - Opened admin@3d8b319e{HTTP/1.1, (http/1.1)}{localhost:8990}
2025-07-30 16:47:15.756 [main] INFO org.eclipse.jetty.server.Server - jetty-10.0.23; built: 2024-08-14T01:14:42.815Z; git: 570aa4a1395ca8f9f800045f3a1fe5fe3af9a598; jvm 17.0.14+7-adhoc…jdk17u
2025-07-30 16:47:20.594 [main] ERROR i.dropwizard.core.cli.ServerCommand - Unable to start server, shutting down
java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError
at com.graphhopper.util.GHUtility.runConcurrently(GHUtility.java:535)
at com.graphhopper.routing.ch.CHPreparationHandler.load(CHPreparationHandler.java:111)
at com.graphhopper.GraphHopper.loadOrPrepareCH(GraphHopper.java:1338)
at com.graphhopper.GraphHopper.postProcessing(GraphHopper.java:1202)
at com.graphhopper.GraphHopper.load(GraphHopper.java:1068)
at com.graphhopper.GraphHopper.importOrLoad(GraphHopper.java:773)
at com.graphhopper.http.GraphHopperManaged.start(GraphHopperManaged.java:44)
at io.dropwizard.lifecycle.JettyManaged.doStart(JettyManaged.java:27)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:171)
at org.eclipse.jetty.server.Server.start(Server.java:470)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:121)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:89)
at org.eclipse.jetty.server.Server.doStart(Server.java:415)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
at io.dropwizard.core.cli.ServerCommand.run(ServerCommand.java:52)
at io.dropwizard.core.cli.EnvironmentCommand.run(EnvironmentCommand.java:67)
at io.dropwizard.core.cli.ConfiguredCommand.run(ConfiguredCommand.java:98)
at io.dropwizard.core.cli.Cli.run(Cli.java:78)
at io.dropwizard.core.Application.run(Application.java:94)
at com.graphhopper.application.GraphHopperApplication.main(GraphHopperApplication.java:37)
Caused by: java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError
at java.base/java.util.concurrent.ForkJoinTask.reportExecutionException(ForkJoinTask.java:605)
at java.base/java.util.concurrent.ForkJoinTask.get(ForkJoinTask.java:981)
at com.graphhopper.util.GHUtility.runConcurrently(GHUtility.java:533)
… 20 common frames omitted
Caused by: java.lang.OutOfMemoryError: null
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
at java.base/java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:564)
at java.base/java.util.concurrent.ForkJoinTask.reportExecutionException(ForkJoinTask.java:604)
… 22 common frames omitted
Caused by: java.lang.OutOfMemoryError: Java heap space
at com.graphhopper.storage.RAMIntDataAccess.loadExisting(RAMIntDataAccess.java:124)
at com.graphhopper.storage.CHStorage.loadExisting(CHStorage.java:159)
at com.graphhopper.routing.ch.CHPreparationHandler.lambda$load$0(CHPreparationHandler.java:103)
at com.graphhopper.routing.ch.CHPreparationHandler$$Lambda$337/0x000002049d375228.run(Unknown Source)
at com.graphhopper.util.GHUtility$$Lambda$336/0x000002049d375000.accept(Unknown Source)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at java.base/java.util.stream.ForEachOps$ForEachTask.compute(ForEachOps.java:290)
at java.base/java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:754)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
at java.base/java.util.concurrent.ForkJoinTask.invoke(ForkJoinTask.java:686)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateParallel(ForEachOps.java:159)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateParallel(ForEachOps.java:173)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:233)
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
at com.graphhopper.util.GHUtility.lambda$runConcurrently$4(GHUtility.java:533)
at com.graphhopper.util.GHUtility$$Lambda$335/0x000002049d374de0.run(Unknown Source)
at java.base/java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1375)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
2025-07-30 16:47:20.594 [main] INFO org.eclipse.jetty.server.Server - Stopped Server@21ac5eb4{STOPPING}[10.0.23,sto=30000]
2025-07-30 16:47:20.594 [main] INFO org.eclipse.jetty.server.Server - Shutdown Server@21ac5eb4{STOPPING}[10.0.23,sto=30000]
2025-07-30 16:47:20.609 [main] WARN i.dropwizard.core.cli.ServerCommand - Failure during stop server
java.util.concurrent.ExecutionException: java.lang.IllegalStateException: STOPPED
at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396)
at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2096)
at org.eclipse.jetty.server.Server.doStop(Server.java:490)
at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:132)
at io.dropwizard.core.cli.ServerCommand.run(ServerCommand.java:56)
at io.dropwizard.core.cli.EnvironmentCommand.run(EnvironmentCommand.java:67)
at io.dropwizard.core.cli.ConfiguredCommand.run(ConfiguredCommand.java:98)
at io.dropwizard.core.cli.Cli.run(Cli.java:78)
at io.dropwizard.core.Application.run(Application.java:94)
at com.graphhopper.application.GraphHopperApplication.main(GraphHopperApplication.java:37)
Caused by: java.lang.IllegalStateException: STOPPED
at org.eclipse.jetty.server.handler.ContextHandler.shutdown(ContextHandler.java:773)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575)
at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616)
at org.eclipse.jetty.util.component.Graceful.shutdown(Graceful.java:146)
… 8 common frames omitted
Thank you for your reply.
We haven’t tried with smaller datasets yet because we actually need to have the entire national graph on VM.
I wonder if Grapphopper can somehow handle small areas or directly handle several regions together, but I don’t think it’s feasible because it only reads a single osm.pbf file.
Yes, it only reads a single osm file. But there are lots of tools that can be used to crop or stitch together OSM files (osmosis or osmium for example). But to check your setup you could also simply use one of Italy’s subregions from here.