[GraphHopper] Android: Unload graph

emux devemux86 at gmail.com
Fri Apr 25 13:14:17 UTC 2014


Hi Peter,

Continuing various tests with GraphHopper at Android I'm in a specific 
situation with memory issues.

I try loading a big graph (e.g. Japan) at application start (following 
the GH android sample app guidelines).
First time all are ok, but if I perform some restarts of the app then 
eventually I see the following errors.

My question: Is there a way to unload / free GH resources at application 
finish?


Couldn't map buffer 456 of 588 at position 478150756 for 616562588 bytes 
with offset 100, new fileLength:616562788
java.lang.RuntimeException: Couldn't map buffer 456 of 588 at position 
478150756 for 616562588 bytes with offset 100, new fileLength:616562788
     at 
com.graphhopper.storage.MMapDataAccess.mapIt(MMapDataAccess.java:159)
     at 
com.graphhopper.storage.MMapDataAccess.loadExisting(MMapDataAccess.java:241)
     at 
com.graphhopper.storage.GraphHopperStorage.loadExisting(GraphHopperStorage.java:1355)
     at com.graphhopper.GraphHopper.load(GraphHopper.java:669)
     ...
Caused by: java.io.IOException: mmap failed: EPERM (Operation not permitted)
     at java.nio.MemoryBlock.mmap(MemoryBlock.java:119)
     at java.nio.FileChannelImpl.map(FileChannelImpl.java:253)
     at 
com.graphhopper.storage.MMapDataAccess.newByteBuffer(MMapDataAccess.java:177)
     at 
com.graphhopper.storage.MMapDataAccess.mapIt(MMapDataAccess.java:151)
     ... 14 more
Caused by: libcore.io.ErrnoException: mmap failed: EPERM (Operation not 
permitted)
     at libcore.io.Posix.mmap(Native Method)
     at libcore.io.ForwardingOs.mmap(ForwardingOs.java:94)
     at java.nio.MemoryBlock.mmap(MemoryBlock.java:116)
     ... 17 more


-- 
Emux
Cruiser <http://wiki.openstreetmap.org/wiki/Cruiser> - Atlas 
<http://wiki.openstreetmap.org/wiki/Atlas_%28navigation_application%29>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/graphhopper/attachments/20140425/a7e870e2/attachment.html>


More information about the GraphHopper mailing list