Graphhopper constantly shuts down

Hey. First of all, great project, it helps us create shapes for transit agency.
I’m running it with my data and standard config file. Also trying to run with more RAM (2gb) for a small region file, which should be enough.
However, after a couple of minutes of the java running, even without any usage of the graphhopper, it shuts down.
Log says only:

        2021-10-18 15:10:34.209 [main] INFO  o.e.jetty.server.AbstractConnector - Started application@6f89292e{HTTP/1.1, (http/1.1)}{}
    2021-10-18 15:10:34.215 [main] INFO  o.e.jetty.server.AbstractConnector - Started admin@20749d9{HTTP/1.1, (http/1.1)}{localhost:8990}
    2021-10-18 15:10:34.215 [main] INFO  org.eclipse.jetty.server.Server - Started @2082ms
    2021-10-18 15:15:20.249 [JettyShutdownThread] INFO  o.e.jetty.server.AbstractConnector - Stopped application@6f89292e{HTTP/1.1, (http/1.1)}{}
    2021-10-18 15:15:20.252 [JettyShutdownThread] INFO  o.e.jetty.server.AbstractConnector - Stopped admin@20749d9{HTTP/1.1, (http/1.1)}{localhost:8990}
    2021-10-18 15:15:20.254 [JettyShutdownThread] INFO  o.e.j.server.handler.ContextHandler - Stopped i.d.j.MutableServletContextHandler@1ec22831{/,null,STOPPED}
    2021-10-18 15:15:20.273 [JettyShutdownThread] INFO  o.e.j.server.handler.ContextHandler - Stopped i.d.j.MutableServletContextHandler@41fa769c{/,null,STOPPED}

Hm, I have never seen this before. Did you try with more memory? Are you running this under Linux?

Yes, im running on ubuntu server 20 lte with 64 ram and 8 cores ! However, i added yesterday 4GB of alloted memory to the java command and since then, it didn’t shutdown. Maybe this is the mistake that was done before - running it with java command without Xmx and Xms…

Yes, the Java default heap size is definitely too small unless your only use a very small OSM file. Usually you should see an ‘insufficient hea’ or ‘OutOfMemory’ error from your java command in case Xmx was too small. You could also check system logs like /var/log/messages to check if the process was killed by the system. But if you did not set Xmx before this was probably the problem.

I started it with 4GB
java -Xmx4g -Xms4g -Ddw.graphhopper.datareader.file=wielkopolskie-latest.osm.pbf -jar *.jar server config-example.yml &
and still, after a while it stops

log is here:

2021-11-11 20:32:26.828 [main] INFO  o.e.j.server.handler.ContextHandler - Started i.d.j.MutableServletContextHandler@23ed382c{/,null,AVAILABLE}
2021-11-11 20:32:26.838 [main] INFO  o.e.jetty.server.AbstractConnector - Started application@77134e08{HTTP/1.1, (http/1.1)}{}
2021-11-11 20:32:26.840 [main] INFO  o.e.jetty.server.AbstractConnector - Started admin@6a0cbc6f{HTTP/1.1, (http/1.1)}{}
2021-11-11 20:32:26.841 [main] INFO  org.eclipse.jetty.server.Server - Started @5211ms
2021-11-11 20:32:51.219 [dw-20 - GET /route?point=52.535203%2C16.825068&point=52.534811%2C16.831076&type=json&locale=pl&key=&elevation=false&profile=car] INFO  c.g.resources.Ro$
2021-11-11 20:33:00.728 [dw-20 - GET /route?point=52.560142%2C16.823952&point=52.534811%2C16.831076&type=json&locale=pl&key=&elevation=false&profile=car] INFO  c.g.resources.Ro$
2021-11-11 20:33:04.605 [dw-19 - GET /route?point=52.560142%2C16.823952&point=52.55903%2C16.839638&type=json&locale=pl&key=&elevation=false&profile=car] INFO  c.g.resources.Rou$
2021-11-11 20:33:13.754 [dw-19 - GET /route?point=52.560142%2C16.823952&point=52.559864%2C16.828008&type=json&locale=pl&key=&elevation=false&profile=car] INFO  c.g.resources.Ro$
2021-11-11 20:34:38.739 [dw-22 - GET /route?point=52.560142%2C16.823952&point=52.580731%2C16.826591&type=json&locale=pl&key=&elevation=false&profile=car] INFO  c.g.resources.Ro$
2021-11-11 20:34:40.604 [dw-20 - GET /route?point=52.579271%2C16.816635&point=52.580731%2C16.826591&type=json&locale=pl&key=&elevation=false&profile=car] INFO  c.g.resources.Ro$
2021-11-11 20:34:57.435 [dw-20 - GET /route?point=52.63973%2C16.821785&point=52.580731%2C16.826591&type=json&locale=pl&key=&elevation=false&profile=car] INFO  c.g.resources.Rou$
2021-11-11 20:34:59.736 [dw-20 - GET /route?point=52.63973%2C16.821785&point=52.640772%2C16.815948&point=52.580731%2C16.826591&type=json&locale=pl&key=&elevation=false&profile=$
2021-11-11 20:35:02.437 [dw-23 - GET /route?point=52.63973%2C16.821785&point=52.640772%2C16.815948&point=52.640668%2C16.813717&type=json&locale=pl&key=&elevation=false&profile=$
2021-11-11 20:41:40.497 [JettyShutdownThread] INFO  o.e.jetty.server.AbstractConnector - Stopped application@77134e08{HTTP/1.1, (http/1.1)}{}
2021-11-11 20:41:40.500 [JettyShutdownThread] INFO  o.e.jetty.server.AbstractConnector - Stopped admin@6a0cbc6f{HTTP/1.1, (http/1.1)}{}
2021-11-11 20:41:40.502 [JettyShutdownThread] INFO  o.e.j.server.handler.ContextHandler - Stopped i.d.j.MutableServletContextHandler@23ed382c{/,null,STOPPED}
2021-11-11 20:41:40.522 [JettyShutdownThread] INFO  o.e.j.server.handler.ContextHandler - Stopped i.d.j.MutableServletContextHandler@4b432e53{/,null,STOPPED}

What is worth mentioning, it would also stop after some 15-30mins after start even when there’s no usage on the server. Tried on two different servers - Ubuntu and Debian, with 16gb and 32gb of ram.
Using graphhopper-web-3.2.jar and standard config with bind localhost uncommented.
Please help!

I also notice, that when i leave the console running, graphhopper stays on, but after i exit the console (ie. disconnect from server) it stops after 15-20 minutes.
I understand that adding & at the end, causes this process to run in background.

This issue has nothing to do with GraphHopper. The & at the end only starts a process in background. Additionally you need to detach it from the parent process (you can use disown or start via nohup). But the best thing is to start GraphHopper via some systemd scripts.

@karussell yes, you are right - sorry for confusing. I used nohup and it should help. Please mark and close this topic.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.