# Openrouteservice ram size for Germany not enough

**URL:** https://ask.openrouteservice.org/t/openrouteservice-ram-size-for-germany-not-enough/1644
**Category:** openrouteservice
**Created:** [May 2, 2020, 10:13am UTC](https://ask.openrouteservice.org/t/openrouteservice-ram-size-for-germany-not-enough/1644 "2020-05-02T10:13:18Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![akudekar](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/akudekar/32/658_2.png) [@akudekar](https://ask.openrouteservice.org/u/akudekar)
#### Post date: [May 2, 2020, 10:13am UTC](https://ask.openrouteservice.org/t/openrouteservice-ram-size-for-germany-not-enough/1644/1 "2020-05-02T10:13:18Z")

</div>

Hi Nils,

I have setup ORS for Germany. The .pbf file is approximately 4 GB. I supplied 20 gigs of ram and it is still stuck on locationindex, the gh.lock is gone and does not build any graphs. I tried doing it overnight. I have removed the profiles I did not need and only have the pedestrian-walk profile. When I set it up for smaller datasets like NRW, it works.

From what I read from some posts, 11 GB of ram is enough for Germany

This is my docker-compose -

> Blockquote  
> version: ‘3’  
> services:  
> ors-app:  
> container\_name: ors-app-ger  
> ports:  
> - 8095:8080  
> restart: unless-stopped  
> build:  
> context: …/  
> args:  
> APP\_CONFIG: ./docker/conf/app.config.sample  
> OSM\_FILE: ./docker/data/germany-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  
> - ./conf/app.config.sample:/ors-core/openrouteservice/target/classes/app.config  
> - ./data/germany-latest.osm.pbf:/ors-core/data/osm\_file.pbf  
> environment:  
> - BUILD\_GRAPHS=true # Forces the container to rebuild the graphs, e.g. when PBF is changed in app.conf  
> - JAVA\_OPTS=“-Djava.awt.headless=true -server -XX:TargetSurvivorRatio=75 -XX:SurvivorRatio=64 -XX:MaxTenuringThreshold=3 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:ParallelGCThreads=4 -Xms18g -Xmx20g”  
> - CATALINA\_OPTS=“-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9001 -Dcom.sun.management.jmxremote.rmi.port=9001 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=localhost”

And this is my config -

> Blockquote  
> {  
> “ors”:{  
> “info”: {  
> “base\_url”: “[https://openrouteservice.org/](https://openrouteservice.org/)”,  
> “support\_mail”: “[support@openrouteservice.org](mailto:support@openrouteservice.org)”,  
> “author\_tag”: “openrouteservice”,  
> “content\_licence”: “LGPL 3.0”  
> },  
> “services”:{  
> “matrix”:{  
> “enabled”:true,  
> “maximum\_routes”:2000000,  
> “maximum\_visited\_nodes”:1000000000,  
> “allow\_resolve\_locations”:true,  
> “attribution”:“[openrouteservice.org](http://openrouteservice.org), OpenStreetMap contributors”  
> },  
> “isochrones”:{  
> “enabled”:true,  
> “maximum\_range\_distance”:[  
> {  
> “profiles”:“any”,  
> “value”:5000000  
> },  
> {  
> “profiles”:“foot-walking”,  
> “value”:10000000  
> }  
> ],  
> “maximum\_range\_time”:[  
> {  
> “profiles”:“any”,  
> “value”:1800000  
> },  
> {  
> “profiles”:“foot-walking”,  
> “value”:360000  
> }  
> ],  
> “maximum\_intervals”:10,  
> “maximum\_locations”:2,  
> “allow\_compute\_area”:true,  
> “attribution”:“[openrouteservice.org](http://openrouteservice.org), OpenStreetMap contributors”  
> },  
> “routing”:{  
> “enabled”:true,  
> “mode”:“normal”,  
> “sources”:[  
> “data/osm\_file.pbf”  
> ],  
> “init\_threads”:1,  
> “attribution”:“[openrouteservice.org](http://openrouteservice.org), OpenStreetMap contributors”,  
> “distance\_approximation”:true,  
> “profiles”:{  
> “active”:[  
> “pedestrian-walk”  
> ],  
> “default\_params”: {  
> “encoder\_flags\_size”: 8,  
> “graphs\_root\_path”: “data/graphs”,  
> “elevation\_provider”: “multi”,  
> “elevation\_cache\_path”: “data/elevation\_cache”,  
> “elevation\_clear\_cache”: true,  
> “instructions”: true,  
> “maximum\_distance”: 10000000,  
> “maximum\_segment\_distance\_with\_dynamic\_weights”: 10000000,  
> “maximum\_distance\_round\_trip\_routes”: 1000000000,  
> “maximum\_waypoints”: 50000000  
> “maximum\_avoid\_polygon\_area”: 20000,  
> “maximum\_avoid\_polygon\_extent”: 2000,  
> },  
> “profile-pedestrian-walk”:{  
> “profiles”:“foot-walking”,  
> “parameters”:{  
> “encoder\_options”:“consider\_elevation=true|turn\_costs=true|block\_fords=false”,  
> “elevation”:true,  
> “preparation”:{  
> “min\_network\_size”:200,  
> “min\_one\_way\_network\_size”:200,  
> “methods”:{  
> “ch”:{  
> “enabled”:true,  
> “threads”:8,  
> “weightings”:“fastest”  
> },  
> “lm”:{  
> “enabled”:true,  
> “threads”:8,  
> “weightings”:“fastest,shortest”,  
> “landmarks”:24  
> }  
> }  
> },  
> “execution”:{  
> “methods”:{  
> “astar”:{  
> “approximation”:“BeelineSimplification”,  
> “epsilon”:1  
> },  
> “ch”:{  
> “disabling\_allowed”:true  
> },  
> “lm”:{  
> “disabling\_allowed”:true,  
> “active\_landmarks”:6  
> }  
> }  
> },  
> “ext\_storages”:{  
> “WayCategory”:{  
> },  
> “WaySurfaceType”:{  
> },  
> “HillIndex”:{  
> },  
> “TrailDifficulty”:{  
> }  
> }  
> }  
> }  
> }  
> }  
> },  
> “logging”: {  
> “enabled”: true,  
> “level\_file”: “PRODUCTION\_LOGGING.json”,  
> “location”: “/var/log/ors”,  
> “stdout”: true  
> },  
> system\_message: [  
> {  
> active: false,  
> text: “This message would be sent with every routing bike fastest request”,  
> condition: {  
> “request\_service”: “routing”,  
> “request\_profile”: “cycling-regular,cycling-mountain,cycling-road,cycling-electric”,  
> “request\_preference”: “fastest”  
> }  
> },  
> {  
> active: false,  
> text: “This message would be sent with every request for geojson response”,  
> condition: {  
> “api\_format”: “geojson”  
> }  
> },  
> {  
> active: false,  
> text: “This message would be sent with every request on API v1 from January 2020 until June 2050”,  
> condition: {  
> “api\_version”: 1,  
> “time\_after”: “2020-01-01T00:00:00Z”,  
> “time\_before”: “2050-06-01T00:00:00Z”  
> }  
> },  
> {  
> active: false,  
> text: “This message would be sent with every request”  
> }  
> ]  
> }  
> }

---

<div class="post-metadata">

### Author: ![mehlkopf](https://ask.openrouteservice.org/letter_avatar_proxy/v4/letter/m/c0e974/32.png) [@mehlkopf](https://ask.openrouteservice.org/u/mehlkopf)
#### Post date: [May 12, 2020, 12:55pm UTC](https://ask.openrouteservice.org/t/openrouteservice-ram-size-for-germany-not-enough/1644/2 "2020-05-12T12:55:21Z")

</div>

I think this could be related to this issue: [https://github.com/GIScience/openrouteservice/issues/696](https://github.com/GIScience/openrouteservice/issues/696) – you can try fixing the problem by removing the quotation marks from JAVA\_OPTS=… and CATALINA\_OPTS=… in your docker-compose.yml.

---

<div class="post-metadata">

### Author: ![nils](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/nils/32/6_2.png) [@nils](https://ask.openrouteservice.org/u/nils)
#### Post date: [May 12, 2020, 1:07pm UTC](https://ask.openrouteservice.org/t/openrouteservice-ram-size-for-germany-not-enough/1644/3 "2020-05-12T13:07:07Z")

</div>

Yeah, you’re right @mehlkopf, it is the same.

Sorry, @akudekar, this wasn’t on my radar. Please try the branch from my PR:

> <https://github.com/GIScience/openrouteservice/pull/717>
>
> \### Pull Request Checklist
> 
> \- \[x\] 1. I have \[\*\*rebased\*\*\](https://github.com/G…IScience/openrouteservice/blob/master/CONTRIBUTE.md#pull-request-guidelines) the latest version of the master branch into my feature branch and all conflicts have been resolved.
> \- \[x\] 2. I have added information about the change/addition to functionality to the CHANGELOG.md file under the \[Unreleased\] heading.
> \- \[\] 3. I have documented my code using JDocs tags.
> \- \[\] 4. I have removed unnecessary commented out code, imports and System.out.println statements.
> \- \[\] 5. I have written JUnit tests for any new methods/classes and ensured that they pass.
> \- \[\] 6. I have created API tests for any new functionality exposed to the API.
> \- \[\] 7. If changes/additions are made to the app.config file, I have added these to the app.config wiki page on github along with a short description of what it is for, and documented this in the Pull Request (below).
> \- \[\] 8. I have built graphs with my code of the Heidelberg.osm.gz file and run the api-tests with all test passing
> \- \[x\] 9. I have referenced the Issue Number in the Pull Request (if the changes were from an issue).
> \- \[\] 10. For new features or changes involving building of graphs, I have tested on a larger dataset (at least Germany) and the graphs build without problems (i.e. no out-of-memory errors).
> \- \[\] 11. For new features or changes involving the graphbuilding process (i.e. changing encoders, updating the importer etc.), I have generated longer distance routes for the affected profiles with different options (avoid features, max weight etc.) and compared these with the routes of the same parameters and start/end points generated from the current live ORS. If there are differences then the reasoning for these \*\*MUST\*\* be documented in the pull request.
> \- \[x\] 12. I have written in the Pull Request information about the changes made including their intended usage and why the change was needed.
> 
> Fixes #696 , EDIT: fixes #718 as well.
> 
> \### Information about the changes
> \- Key functionality added: 
> - changes to host's \`app.config\` are reflected now inside the container
> - \`CATALINA/JAVA\_OPTS\` are set correctly
> - \`app.config\` doesn't have to be present when starting a container, which finally makes it independent of this repository and fully available for Dockerhub images
> 
> \### Things to test
> 
> 1. Custom \`app.config\`:
> - build image locally and run a container in a directory other than this repository (e.g. \`/tmp\`)
> - change \`app.config.sample\` which is now supposed to be mapped to \`./conf/app.config.sample\`
> - restart container and confirm changes took effect
> 
> 2. use other PBF as a volume and \`BUILD\_GRAPHS=True\`, which should delete \`./graphs/\*\` and regenerate

---

<div class="post-metadata">

### Author: ![akudekar](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/akudekar/32/658_2.png) [@akudekar](https://ask.openrouteservice.org/u/akudekar)
#### Post date: [May 25, 2020, 11:08am UTC](https://ask.openrouteservice.org/t/openrouteservice-ram-size-for-germany-not-enough/1644/4 "2020-05-25T11:08:31Z")

</div>

@mehlkopf @nils

That worked. Thank you so much for the help.
