java.lang.OutOfMemoryError

Hey! I’m using ORS Local with Java and the QGIS plugin. I’m also using the .pbf file for the whole of Germany. Using Java with the parameters -Xms6g -Xmx8g -jar ors.jar and one profile (car), I managed to set it up. I increased the maximum number of routes so that I could calculate a matrix with 270,000,000 routes. Now, inside the plugin window in QGIS, I’m getting this error:

GenericServerError: 500 ({“error”:{“message”:“Handler dispatch failed: java.lang.OutOfMemoryError: Java heap space”},“info”:{“engine”:{“build_date”:“2025-11-14T08:23:02Z”,“graph_version”:“3”,“graph_date”:“2025-12-15T16:52:12Z”,“osm_date”:“2025-12-13T21:21:44Z”,“version”:“9.5.1”},“timestamp”:1765824391598}})

I think I understand what the problem is, but I don’t know what to do next. I tried using the parameters -Xms10g and -Xmx12g because my PC has 16 GB of RAM, but the result was the same. I thought about allocating more RAM to QGIS, but I couldn’t find a way to do it. So here I am, asking for advice about my problem.

Hey,

a matrix with 270 million routes sounds a tad bit too large for 16 GB of RAM…

Keep in mind that the openrouteservice will have to keep your result in memory until it returns the API call.
Thus, all those 270M routes (and data corresponding to their calculation) have to be kept in memory until ors returns.

I suppose going with a way lower (i.e. about 4-6 orders of magnitude lower) number of routes in matrix calculation will solve the issue.

Best regards