<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Hey Emux,<br>
      <br>
      on application finish you should call hopper.close();<br>
      Let me know if this helped and please create an issue/pull request
      if that is not in the Android sample.<br>
      <br>
      Regards,<br>
      Peter.<br>
      <br>
    </div>
    <blockquote cite="mid:535A5FA9.6010109@gmail.com" type="cite">
      <meta http-equiv="content-type" content="text/html;
        charset=ISO-8859-1">
      Hi Peter,<br>
      <br>
      Continuing various tests with GraphHopper at Android I'm in a
      specific situation with memory issues.<br>
      <br>
      I try loading a big graph (e.g. Japan) at application start
      (following the GH android sample app guidelines).<br>
      First time all are ok, but if I perform some restarts of the app
      then eventually I see the following errors.<br>
      <br>
      My question: Is there a way to unload / free GH resources at
      application finish?<br>
      <br>
      <br>
      Couldn't map buffer 456 of 588 at position 478150756 for 616562588
      bytes with offset 100, new fileLength:616562788<br>
      java.lang.RuntimeException: Couldn't map buffer 456 of 588 at
      position 478150756 for 616562588 bytes with offset 100, new
      fileLength:616562788<br>
          at
      com.graphhopper.storage.MMapDataAccess.mapIt(MMapDataAccess.java:159)<br>
          at
com.graphhopper.storage.MMapDataAccess.loadExisting(MMapDataAccess.java:241)<br>
          at
com.graphhopper.storage.GraphHopperStorage.loadExisting(GraphHopperStorage.java:1355)<br>
          at com.graphhopper.GraphHopper.load(GraphHopper.java:669)<br>
          ...<br>
      Caused by: java.io.IOException: mmap failed: EPERM (Operation not
      permitted)<br>
          at java.nio.MemoryBlock.mmap(MemoryBlock.java:119)<br>
          at java.nio.FileChannelImpl.map(FileChannelImpl.java:253)<br>
          at
com.graphhopper.storage.MMapDataAccess.newByteBuffer(MMapDataAccess.java:177)<br>
          at
      com.graphhopper.storage.MMapDataAccess.mapIt(MMapDataAccess.java:151)<br>
          ... 14 more<br>
      Caused by: libcore.io.ErrnoException: mmap failed: EPERM
      (Operation not permitted)<br>
          at libcore.io.Posix.mmap(Native Method)<br>
          at libcore.io.ForwardingOs.mmap(ForwardingOs.java:94)<br>
          at java.nio.MemoryBlock.mmap(MemoryBlock.java:116)<br>
          ... 17 more<br>
    </blockquote>
    <br>
  </body>
</html>