OsmSharp / ui

The UI components.
http://osmsharp.com/
GNU General Public License v2.0
139 stars 91 forks source link

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

Open Lotto2 opened 7 years ago

Lotto2 commented 7 years ago

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

xivk commented 7 years ago

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

https://github.com/itinero/routing

More explanation:

http://www.osmsharp.com/

Lotto2 commented 7 years ago

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.

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

Greetz Lothar