Memory Usage Local Matrix GB

Hi,
I have roughly 10,000 locations whereby I want to generate a matrix from each origin to every destination. I have set it up so that it runs each origin to 10K destinations and then writes to a csv file.

However, if I leave this running overnight, the PC eventually grinds to a halt and instead of taking a couple of minutes to run a matrix it could take hours to do one? Why is this the case. Also, why does just running the VM without actually requesting a matrix use 5GB of memory?

Does the docker/ORS have a cut off point of running or does it suck all the memory eventually? Is there a way of capping how much memory it uses and why is grinding to a halt?

This is the docker build I am using (see below) Is it configured here or in the config file?

docker run -dt --name ors-app -p 8080:8080 -e BUILD_GRAPHS=False -v c:/ors-config/graphs:/ors-core/data/graphs -v c:/ors-config/elevation_cache:/ors-core/data/elevation_cache -v c:/ors-config/conf:/ors-conf -v C:/OSMFiles/great-britain-latest.osm.pbf:/ors-core/data/osm_file.pbf -e "JAVA_OPTS=-Djava.awt.headless=true -server -XX:TargetSurvivorRatio=75 -XX:SurvivorRatio=64 -XX:MaxTenuringThreshold=3 -XX:+UseG1GC -XX:ParallelGCThreads=4 -Xms4g -Xmx4g -XX:MaxMetaspaceSize=512m" -e "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" openrouteservice/openrouteservice:latest

Cheers
Joe

Hey,

you’re running great-britain-latest.osm.pbf which according to geofabrik is roughly 1.4 GB in size. Have a look here on information about RAM usage, but something like 5GB seems quite normal to me.

You configured your system to use a maximum of 4 GB (-Xmx4g), which is probably to little and would explain why it’d stop building the graphs.

If you are a bit more specific with what you mean by “grinds to a halt” - does building fail, does a running server fail, … there might be more to say about your problem :slight_smile:

Best regards

Hi,
Thanks for getting back to me. What would you recommend setting this to: Xms4g -Xmx4g. If I changed this to Xms5g -Xmx5g does that mean it would use 5GB. Are they are other settings in the docker build that will allow more memory to be used and run more effectively.

I think the graphs got built ok but the issue is more that if I have been running the docker for a prolonged period of time, i.e overnight, it will eventually take hours to get a response from the local ORS machine instead of minutes?

Cheers
Joe

Hey,

to me, setting -Xms5g sounds good, and I’d set -Xmx to whatever your machine can handle - the more, the merrier :wink:
Especially if you’re trying to get fast matrix responses you should check that you have this config parameter enabled.

Increasing the number of locations will non-linearly increase time, so maybe running ten 1-to-1000 requests might be faster?

Best regards

Hi,
Thanks, so if my PC has 32gb of RAM, if I set the -Xmx to -Xmx16g would this speed up the matrix responses compared to -Xmx5g?

Apologies for my lack of understanding, what do you mean by running ten 1-to-1000 requests might be faster exactly? Are you saying run say 1000 in one go and then restart the docker and run another 1,000 ten times to cover 10,000 origins?

Cheers
Joe

Hey,

I don’t think setting -Xmx16g would speed it up, but it would reduce the risk of running out of memory and thus failing somewhere.

You said you’re running each origin to 10K destinations.

I propose running each origin to 1K destinations and doing this 10 times to cover all 10K destinations.

Best regards