You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
With turn costs something requires a lot more memory on import #916
If I just want to import a city (~50MB source map) and import this with car, without turn costs and 1g RAM, then all is fine. But with turn_costs=true the import fails with:
2016-12-21 10:48:31,271 [main] INFO com.graphhopper.reader.osm.GraphHopperOSM - using car|RAM_STORE|2D|turn_cost|,,,,, memory:totalMB:981, usedMB:46
Exception in thread "pool-3-thread-2" java.lang.OutOfMemoryError: GC overhead limit exceeded
at com.graphhopper.reader.ReaderElement.<init>(ReaderElement.java:40)
at com.graphhopper.reader.ReaderNode.<init>(ReaderNode.java:42)
at com.graphhopper.reader.osm.pbf.PbfBlobDecoder.processNodes(PbfBlobDecoder.java:238)
As the overhead of turn costs should be neglectable and the import itself should work with <500MB this seems to be a bug.
See also "Why do we have static edge and node IDs" #556
Interesting reason. It looks like the reading is just faster then the graph creation and due to the unbounded (ouch!) queue PbfDecoder.blobResults we get many objects in this list, leading to the high memory usage.
A workaround via setting datareader.worker_threads=1 does work (the commit below is required -> we had code which prevent lower than 2 worker threads inside OSMInputFile). Then the import will work with 1g but still not with less!
We need to fix:
use a bounded & blocking queue for PbfDecoder.blobResults
look for potentially faster graph creation when turn costs are enabled
Can only reproduce it for the pbf 'Muenchen' but not for much larger areas like sachsen or bavaria. This is due to a large size of many "primitive groups". See PbfBlobDecoder.processOsmPrimitives ... will print a warning for this case.
Has anyone experience with the warning we print right now?
When I run bigger imports, there are tons of warnings like that: 2017-01-18 00:08:01,189 [pool-4-thread-2] WARN com.graphhopper.reader.osm.pbf.PbfBlobDecoder - Processing unusual large OSM primitive group could result in memory problems, workaround is to increase -Xmx and see #916. nodes:2613147 | 1740227, 0, ways: 0, rels:0
Anyone else having this issue? Can this warning be ignored or might it point out an actual issue with my PBF? I extract a part of the planet.osm.pbf.
A workaround via setting datareader.worker_threads=1 does work
The workaround was regarding the higher memory consumption. The underlying issue is that your pbf (as well as my example) seem to have several times bigger blobs than usual which causes a very high memory requirement, but this is only strange for small areas. So it might be good to avoid this warning completely.
Activity
karussell commentedon Dec 21, 2016
Interesting reason. It looks like the reading is just faster then the graph creation and due to the unbounded (ouch!) queue
PbfDecoder.blobResultswe get many objects in this list, leading to the high memory usage.A workaround via setting
datareader.worker_threads=1does work (the commit below is required -> we had code which prevent lower than 2 worker threads inside OSMInputFile). Then the import will work with 1g but still not with less!We need to fix:
PbfDecoder.blobResultsreduce memory usage of import a bit when turn costs are enabled and a…
fixed code (list->queue) and tests after commit for #916
reduce memory usage of import a bit when turn costs are enabled and a…
fixed code (list->queue) and tests after commit for #916
karussell commentedon Jan 13, 2017
Can only reproduce it for the pbf 'Muenchen' but not for much larger areas like sachsen or bavaria. This is due to a large size of many "primitive groups". See PbfBlobDecoder.processOsmPrimitives ... will print a warning for this case.
print warning for unusual partitioned PBF files, #916
boldtrn commentedon Jan 17, 2017
Has anyone experience with the warning we print right now?
When I run bigger imports, there are tons of warnings like that:
2017-01-18 00:08:01,189 [pool-4-thread-2] WARN com.graphhopper.reader.osm.pbf.PbfBlobDecoder - Processing unusual large OSM primitive group could result in memory problems, workaround is to increase -Xmx and see #916. nodes:2613147 | 1740227, 0, ways: 0, rels:0Anyone else having this issue? Can this warning be ignored or might it point out an actual issue with my PBF? I extract a part of the planet.osm.pbf.
Is this still true? Or is this fixed?
karussell commentedon Jan 18, 2017
The workaround was regarding the higher memory consumption. The underlying issue is that your pbf (as well as my example) seem to have several times bigger blobs than usual which causes a very high memory requirement, but this is only strange for small areas. So it might be good to avoid this warning completely.
boldtrn commentedon Jan 19, 2017
Thanks for clearing this up. Not sure, I was just wondering as my log was completely cluttered with this information.
karussell commentedon Jan 19, 2017
We have to remove this warning, as large PBFs seem to have large blobs ...
remove warning. pbfs with large blob entries seems to be valid and co…