<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 Alex,<br>
      <br>
      I have not yet heard about this issue. There are alternatives to
      trove but definitely not the standard collection libraries due to
      memory usage and also performance. See also this issue:<br>
      <a class="moz-txt-link-freetext" href="https://github.com/graphhopper/graphhopper/issues/34">https://github.com/graphhopper/graphhopper/issues/34</a><br>
      <br>
      But I think this problem should be easily solvable via autojar or
      a similar tools which remove unused classes of jars.<br>
      <br>
      java -jar autojar-2.1/autojar.jar -o trove4j-stripped.jar -c
      $TROVE/target/classes @trove-class.list<br>
      <br>
      where trove-class.list is a file with the required classes for
      GraphHopper as content**<br>
      <br>
      Regards,<br>
      Peter.<br>
      <br>
      **<br>
      gnu.trove.list.TDoubleList.class<br>
      gnu.trove.list.TIntList.class<br>
      gnu.trove.list.array.TDoubleArrayList.class<br>
      gnu.trove.list.array.TIntArrayList.class<br>
      gnu.trove.map.TIntObjectMap.class<br>
      gnu.trove.map.hash.TIntObjectHashMap.class<br>
      gnu.trove.map.hash.TIntIntHashMap.class<br>
      gnu.trove.set.hash.TIntHashSet.class<br>
      gnu.trove.iterator.TIntIterator.class<br>
      gnu.trove.procedure.TIntProcedure.class<br>
      gnu.trove.procedure.TObjectProcedure.class<br>
      gnu.trove.stack.array.TIntArrayStack.class<br>
      <br>
      <br>
    </div>
    <blockquote
cite="mid:CAN3Fzp7Gvy_zS5tE0gO_kTrrnaY2r9eh20B3_KMN0u7KF=0h4Q@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hi, 
        <div><br>
        </div>
        <div>I don't know if this has been discussed before, but while
          developping my android app with graphhopper support I have hit
          the infamous dalvik error : </div>
        <div>Conversion to Dalvik format failed with error 2 <br>
        </div>
        <div>trouble writing output: Too many methods: 72332; max is
          65536. By package:<br>
        </div>
        <div><br>
        </div>
        <div>As per stackoverflow and android coummunity this is due to
          a too large codebase for my app = too many methods. </div>
        <div><br>
        </div>
        <div>The error log gives me a method count per package and it
          seems the gnu trove which is used by graphhopper is very
          greedy in that domain. for example the error log give me </div>
        <div><br>
        </div>
        <div>
          <div>
              446 gnu.trove</div>
          <div>  3066 gnu.trove.decorator</div>
          <div>     8 gnu.trove.function</div>
          <div>    13 gnu.trove.impl</div>
          <div>  1139 gnu.trove.impl.hash</div>
          <div>  2658 gnu.trove.impl.sync</div>
          <div>  3010 gnu.trove.impl.unmodifiable</div>
          <div>   404 gnu.trove.iterator</div>
          <div>     2 gnu.trove.iterator.hash</div>
          <div>   339 gnu.trove.list</div>
          <div>   602 gnu.trove.list.array</div>
          <div>   674 gnu.trove.list.linked</div>
          <div>  1763 gnu.trove.map</div>
          <div>
               798 gnu.trove.map.custom_hash</div>
          <div>  8147 gnu.trove.map.hash</div>
          <div>    72 gnu.trove.procedure</div>
          <div>     2 gnu.trove.procedure.array</div>
          <div>    28 gnu.trove.queue</div>
          <div>   175 gnu.trove.set</div>
          <div>
               396 gnu.trove.set.hash</div>
          <div>    56 gnu.trove.stack</div>
          <div>   133 gnu.trove.stack.array</div>
          <div>     6 gnu.trove.strategy</div>
        </div>
        <div><br>
        </div>
        <div>TOTAL : 23'397 methods just for trove. WOW ! </div>
        <div>
          <br>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div> 23'397 methods is almost one third of what is allowed by
          dalvik VM for a dex file. So once you app gets a little
          complex and you want to use graphhopper the limit can be
          reached quite easily. <br>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>
          <div>Now my question is : is there a way to avoid trove in
            graphhopper for example by replaceing trove collections by
            standard java collections ?</div>
          <div>Or would it be possible to find an alternate lighter
            (shrinked) )version of trove or another collections
            library. </div>
          <div>Would there be a huge performace difference ? </div>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>Thank you for your help. I'm a bit stuck here. </div>
        <div><br>
        </div>
        <div>Cheers, </div>
        <div><br>
        </div>
        <div>Alex</div>
        <div>
          <br>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
GraphHopper mailing list
<a class="moz-txt-link-abbreviated" href="mailto:GraphHopper@openstreetmap.org">GraphHopper@openstreetmap.org</a>
<a class="moz-txt-link-freetext" href="https://lists.openstreetmap.org/listinfo/graphhopper">https://lists.openstreetmap.org/listinfo/graphhopper</a>
</pre>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
GraphHopper.com - Fast & Flexible Road Routing</pre>
  </body>
</html>