-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Valhalla routing causes memory issues on Jolla 1 #153
Comments
That's a bummer! What I can see from the stats that I collected over the development, the code size has increased from ~60MB to 140MB (peaking 200MB sometimes) and the RSS staying relatively constant, maybe even smaller now than in January (450MB for me now). But let's try to reduce memory consumption as much as we can. I presume you are using Mapnik/Geocoder-NLP/Valhalla. It all starts up and the problem appears only while route search, right? To reduce RAM to minimum:
If this will not help, let's try:
Please let me know how it went. I sincerely hope we could fit it into J1 |
I changed the default settings according to your advice, and that did certainly help. Especially the memory usage of harbour-osmscout-server-module-route dropped. Re enabling "Load libpostal on every call" does not seem to make a big difference, so the cache of Valhalla seems to be the culprit. Routing using a value of 64MB also went fine (about up to 20% mem for harbour-osmscout-server-module-route). edit: using 32 MB now, still had some crashes with 64MB every now and then. |
I tested it with 16MB and it all seemed to be fine when calculating routes in Sweden. I think that I set 16MB as a minimum in GUI. Try to test whether the speed is fine with 16MB or whether you see better performance with 32MB. Then we can set the cache default to the corresponding value. |
It's hard to seen any difference between using 32 or 16 MB. But it is certainly faster than libosmscout :-) |
Great! The most important is that it works for you know on J1! So, all we have to do is to make sensible default and warn current users of OOM kill danger. I'll see how to check for RAM amounts and maybe its rather simple to setup 16MB as a default for 1GB RAM variants and bit more for the larger ones (64MB for 2GB and 128 for 3GB and up, for example). Let's keep issue alive until the defaults are changed. |
And an additional remark: routes by bike of foot are more complex. It kept on crashing while a was looking for a route on bike (16 MB memory allocated), but it searched for a town 188 km away instead of 50 km away. More realistic distances by bike or foot just work. |
Well, all we specify is tile cache. Other internal Valhalla structures do take additional memory and I don't know any mechanisms to regulate that. However, it should be possible to limit maximal radius for the route search. Would have to look into it. |
Sound logical. |
:) good tip! |
In the development version, its possible to set Valhalla's routing limits to avoid too complicated routes. Defaults are relatively conservative, so it should limit the crashes. For this to work, the next version of the router would be needed as well. In practice, I would have to release either the server and the router simultaneously, or router after the server (otherwise it would break). Closing the issue since the problems should be resolved now. |
I have been trying the new Valhalla routing on my Jolla One, but found it unusable.
Harbour-osmscout-server-module-route and harbour-osmscout-server use too much memory, so harbour-osmscout-server get's killed during route searches, leaving harbour-osmscout-server-module-route as an orphan. I am using Poor Maps, and the routes are not that complex.
Disabling Valhalla causes no memory issues (the harbour-osmscout-server-module-route process is not present, making a big difference).
The text was updated successfully, but these errors were encountered: