[GraphHopper] GraphHopper + Genymotion mounted shared folder
Peter K
peathal at yahoo.de
Sat Apr 26 17:06:10 UTC 2014
Hi Emux,
it looks like memory mapped file is not supported for this VM or
something. Already the very first mmap fails for this call:
buf = raFile.getChannel().map(FileChannel.MapMode.READ_WRITE, offset,
byteCount);
Maybe you ask the vendor of that VM?
Mapsforge just reads from the file and maintains a kind of a cache
itself. We are a lot lazier for GraphHopper and just memory map the file
which normally works very well where the OS maintains the cache for us.
Regards,
Peter.
> Hi Peter,
>
> I use the various Genymotion VMs for debugging Android apps.
> These VMs have the very useful feature 'Shared folders'.
> i.e. at VirtualBox VM's settings you can define a shared folder from
> host OS
> and see it inside the Android environment as mounted read/write folder.
>
> This can be help a lot during testing large mapsforge maps or GH graphs.
> They can remain at host OS disk and not needed to copy them to device
> / emulator sdcard.
> With the Mapsforge map library this feature works fine.
>
> But when I try loading a graph that exists at this read/write mounted
> folder the following exceptions are thrown:
>
> Couldn't map buffer 0 of 31 at position 100 for 32505756 bytes with
> offset 100, new fileLength:32505956
> java.lang.RuntimeException: Couldn't map buffer 0 of 31 at position
> 100 for 32505756 bytes with offset 100, new fileLength:32505956
> 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:670)
> ...
> Caused by: java.io.IOException: mmap failed: EINVAL (Invalid argument)
> 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: EINVAL (Invalid
> argument)
> 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/20140426/29dcf9b9/attachment.html>
More information about the GraphHopper
mailing list