GC overhead limit exceeded issue

Hi all,

I have been tasked with checking out this service with the limitation that I cannot use docker
as such I’ve been following the the steps to build from source here

So far things have been going fine I’ve been able to get the service to run if I run the tomcat 8 server in the foreground without errors. However when I try to start the server as a background service I get a

ERROR [routing.RoutingProfileManager] - java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: GC overhead limit exceeded

I have set up my environment using the following env values

JAVA_OPTS= -server -XX:TargetSurvivorRatio=75 -XX:SurvivorRatio=64 -XX:MaxTenuringThreshold=3 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:ParallelGCThreads=4 -Xms1000M -Xmx2000M -XX:MaxMetaspaceSize=50m

CATALINA_OPTS=-Xms1000M -Xmx2000M

my pbf file is only 311 mb

I have played with the java heap sizes to see if anything would change but its always the same outcome.

At this point I’m at a loss and hoping one of you fine folks will be able to point me in the right direction



  • I am only using two profiles

  • I’m working in a windows environment

  • I have increased heap size to 5g

  • I am deleting the graphs folder from the server with every attempt

Edit 2:
For anyone having a similar issue using windows service tom cat you have to set the heap size using the “tomcat8w.exe” configuration utility the env scripts will be ignored completely when running as a windows service.

Hey Matt,

my first guess would be that it has to do with java heap sizes - according to this post you’ll need about twice the pbf file-size in RAM per profile.

By default, you’re building 9 profiles (see the ors.services.routing.profiles.active-list in your app.config). That would mean you’d need about 5-6 GB of ram.

Have you tried setting up using the included heidelberg.osm.gz-file? That one should probably run even with low RAM. Other than that, if you don’t need all active profiles, you can remove them from the active-list and try with that.

Note, that it is entirely possible that I’m completely on the wrong track with this, so this is merely a collection of ideas for debugging :slight_smile:

Best regards

I haven’t tried with the default file I suppose I could give that a go.
I have however limited the profiles to two the car and hgv and set the max heap to 4gb but still the same error persists

Haha no worries any help is good help Thanks a lot!


just as a quick side note:
If you’re changing stuff in the app.config, remember to delete the graphs-folder - otherwise the openrouteservice will continue to use what is there, and what might have been built with the old config.

Best regards

I did not think of that ill start doing it even though they tend to be empty folders I’ve also added the steps you’ve mentioned to the original post so people don’t have to troll all the comments.
Thanks again!


I noticed two things that confuse me. What do you mean by

Can you query localhost:8082/ors/v2/health (or the corresponding port, war-file, … on your machine) and does it return status: ready?


is rather strange, as long as we’re talking about graphs folders. They should be rather un-empty.
Could you post the output of building and running the ors?

Best regards

Yeah so what I mean by the first part is if I use the startup.bat file it will work and after about 15 or so minutes I will get a ready response from the health end point and graphs will definitely contain data. but this opens up a console window and all the logs and such write to it and if I close it everything stops.

Since I’m running it on windows I also have a nifty option to run tomcat as a windows service which is going to have it be a background process (no console window) and in that way it will just always be running as long as the physical machine is on.

Okay so it seem this was all related to the way the windows service variant of tomcat server works it seems it ignores the sentenv scripts entirely so to set the heap sizes you have to use the tomcat8w.exe.
Now that I’ve done that I have a new error

java.util.concurrent.ExecutionException: java.lang.RuntimeException: Couldn’t process file Data\OpenRouteService\florida-latest.osm.pbf, error: Index: 20086542, Size: 0

Thanks for all the help I Appreciate it Ill go look into the new error