ui icon indicating copy to clipboard operation
ui copied to clipboard

Out-Of-Memory-Exception Routing.Router.CreateLiveFrom

Open Lotto2 opened this issue 9 years ago • 2 comments

Hello,

if i try to initialize a router with a PBF-File bigger than 15MB i get this out-of-memory-exception. Task-Manager shows a lot of memory still available.

VB-Code like this

`Dim FnOsmFile$="D:\BigFile.Pbf" Dim interpreter = New OsmRoutingInterpreter() Public router As Routing.Router Public PbfStreamSource As PBFOsmStreamSource

        PbfStreamSource = New PBFOsmStreamSource(New FileInfo(FnOsmFile$).OpenRead())
        router = Routing.Router.CreateLiveFrom(PbfStreamSource, interpreter)`

For the task i'm working on i should be able to work with files around 50MB. The attachment-PBF-file is a sample (25MB) that causes the error.

Any chance to get an improvement of Router.CreateLiveFrom?

planet_6.905,50.987_7.532,51.238.osm.zip

Lotto2 avatar Sep 09 '16 14:09 Lotto2

For routing, it's best you move to Itinero:

https://github.com/itinero/routing

More explanation:

http://www.osmsharp.com/

xivk avatar Sep 09 '16 15:09 xivk

Hi Ben,

i tried to run a sample-program using itinero. I'm running into out-of-memory-exception with a 30MB-PBF-file as well in line

routerDb.LoadOsmData(strm, Vehicle.Car)

When the error occured for the first time i was prompted for a file: 'Error in Protobuf', file named something like CompiledSerialization.Cs. I can't find such a file in Protobuf-master. Perhaps it's in a package. Second and following tries raised the error in OsmSharp.dll.

  1. The OsmSharp-Router had a function Router.CalculateRange. The itinero-Router misses this function?

Greetz Lothar

Lotto2 avatar Sep 13 '16 08:09 Lotto2