GIScience / openrouteservice

🌍 The open source route planner api with plenty of features.
https://openrouteservice.org
GNU General Public License v3.0
1.33k stars 379 forks source link

Out of Memory on init of the server #612

Closed kubasienki closed 4 years ago

kubasienki commented 4 years ago

Hi,

I'm trying to run whole Poland with ORS with no success.

The problem I'm getting is:

2019-11-15 08:17:07,556 ERROR [routing.RoutingProfileManager] - java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Java heap space - problem when allocating new memory. Old capacity: 1048576, new bytes:477285440, segmentSizeIntsPower:20, new segments:456, existing:1

I've set memory to 16GB and I've seen that people run other countries with similar area with less memory. However this java.lang.OutOfMemoryError seems kinda strange to me (but googling doesn't help, I'm flooded with normal type of error)

Running via docker, here's my docker-compose.yml:

version: '3' services: ors-app: container_name: ors-app ports:

  • 8080:8080
  • 9001:9001 build: context: ../ args: APP_CONFIG: ./docker/conf/app.config.sample OSM_FILE: ./docker/data/poland-latest.osm.pbf volumes:
    • ./graphs:/ors-core/data/graphs
    • ./elevation_cache:/ors-core/data/elevation_cache
    • ./logs/ors/:/var/log/ors/
    • ./logs/tomcat/:/usr/local/tomcat/logs environment:
    • JAVA_OPTS=-Djava.awt.headless=true -server -XX:TargetSurvivorRatio=75 -XX:SurvivorRatio=64 -XX:MaxTenuringThreshold=3 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:ParallelGCThreads=4 -Xms8g -Xmx15g
    • CATALINA_OPTS= -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9001 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=localhost

Could you help?

kubasienki commented 4 years ago

May be the problem with the docker file and these two lines:

RUN echo "CATALINA_OPTS=\"$CATALINA_OPTS\"" >> /usr/local/tomcat/bin/setenv.sh
RUN echo "JAVA_OPTS=\"$JAVA_OPTS\"" >> /usr/local/tomcat/bin/setenv.sh

Based on this thread: https://ask.openrouteservice.org/t/unable-to-run-private-docker-instance/1091/2

rabidllama commented 4 years ago

There was a PR merge into development a couple of days ago (https://github.com/GIScience/openrouteservice/pull/608) that may help with that. It might be worth trying the development branch if you are running it via a git clone and see if that fixes the problem, as the next release is still a couple of weeks away

mehlkopf commented 4 years ago

@kubasienki Editing docker_entrypoint.sh as described in this issue might help! But the JAVA_OPTS/CATALINA_OPTS arguments have to be passed as environment (contrary to build in #608) arguments to work for me.

rabidllama commented 4 years ago

I will close this issue for now as there was no feedback from the initial poster, and discussion can continue on the #696 issue