itinero / routing

The routing core of itinero.
Apache License 2.0
221 stars 70 forks source link

Question Memory requirements for large RouterDb #248

Closed TomQv closed 5 years ago

TomQv commented 5 years ago

Is it realistic to hope, that it will be possible to load a contracted RouterDb of whole Europe on normal consumer PCs (win/osx) or even mobile devices? Despite the filesize, how would the memory requirements be? It seems that its controlled here RouterDb Deserialize(Stream stream, RouterDbProfile profile) but in which way?

xivk commented 5 years ago

This is related to this issue:

https://github.com/itinero/routing/issues/247

Basically now you have the option between:

  1. Load everything in memory.
  2. Read everything from a stream on-the-fly.

1 is what is usually done when building something server-side with Itinero and 2 is what is done on mobile.

Issue #247 is to have a look at what can be done to something in between. For example to partially load the data critical for fast routing in memory and leave the rest for reading from the routerdb. For most scenarios that have a single user in a desktop app 2 should suffice when having contracted profiles.

Europe I estimate between 7-14GB depending on what profiles you want. If you contracted profiles on top of this it would increase even more.

TomQv commented 5 years ago

What I learned so far, that using this RouterDb Deserialize(Stream stream) loads the whole routerdb in memory.

But what are the RouterDbProfile doing, if using RouterDb Deserialize(Stream stream, RouterDbProfile profile) ? NoCache: lowest memory requirement MobileLowEnd: ? MobileHighEnd: ? Default: ?

xivk commented 5 years ago

It's exactly those three that need an update in #247

Currently they are useless because they all perform worse than NoCache when at the same time using more memory but I think we can improve on that.

TomQv commented 5 years ago

Ok, thanks, just wanted to clarify.

xivk commented 5 years ago

Sure, np :+1:

Closing this in favour of #247, feel free to reopen if you have other questions.