diff --git a/OsmAnd-java/src/main/java/net/osmand/router/RoutePlannerFrontEnd.java b/OsmAnd-java/src/main/java/net/osmand/router/RoutePlannerFrontEnd.java index 6dd110fc22..9ebdb906ad 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/RoutePlannerFrontEnd.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/RoutePlannerFrontEnd.java @@ -234,6 +234,7 @@ public class RoutePlannerFrontEnd { if (intermediates != null) { for (LatLon l : intermediates) { if (!addSegment(l, ctx, indexNotFound++, points, false)) { + System.out.println(points.get(points.size() - 1).getRoad().toString()); return null; } } @@ -364,7 +365,7 @@ public class RoutePlannerFrontEnd { ctx.calculationProgress.segmentNotFound = indexNotFound; return false; } else { - log.info("Route segment found " + f.getRoad().id + " " + f.getRoad().getName()); + log.info("Route segment found " + f.road); res.add(f); return true; } @@ -383,6 +384,10 @@ public class RoutePlannerFrontEnd { ctx.precalculatedRouteDirection = routeDirection.adopt(ctx); } if (ctx.nativeLib != null) { + ctx.startX = start.preciseX; + ctx.startY = start.preciseY; + ctx.targetX = end.preciseX; + ctx.targetY = end.preciseY; return runNativeRouting(ctx, recalculationEnd); } else { refreshProgressDistance(ctx); diff --git a/OsmAnd-java/src/main/java/net/osmand/router/RoutingContext.java b/OsmAnd-java/src/main/java/net/osmand/router/RoutingContext.java index 77e08443db..2e657a8c5c 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/RoutingContext.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/RoutingContext.java @@ -436,7 +436,7 @@ public class RoutingContext { } TLongIterator it = ts.iterator(); TLongObjectHashMap excludeDuplications = new TLongObjectHashMap(); - while(it.hasNext()){ + while (it.hasNext()) { getAllObjects(it.next(), toFillIn, excludeDuplications); } timeToFindInitialSegments += (System.nanoTime() - now); @@ -467,15 +467,14 @@ public class RoutingContext { long h2 = runGCUsedMemory(); float mb = (1 << 20); log.warn("Unload tiles : estimated " + (sz1 - sz2) / mb + " ?= " + (h1 - h2) / mb + " actual"); - log.warn("Used after " + h2 / mb + " of " + Runtime.getRuntime().totalMemory() / mb + " max " - + maxMemory() / mb); + log.warn("Used after " + h2 / mb + " of " + Runtime.getRuntime().totalMemory() / mb ); } else { float mb = (1 << 20); int sz2 = getCurrentEstimatedSize(); log.warn("Unload tiles : occupied before " + sz1 / mb + " Mb - now " + sz2 / mb + "MB " + memoryLimit / mb + " limit MB " + config.memoryLimitation / mb); long us2 = (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()); - log.warn("Used memory before " + us1 / mb + "after " + us1 / mb + " of max " + maxMemory() / mb); + log.warn("Used memory before " + us1 / mb + "after " + us1 / mb ); } } if (!indexedSubregions.containsKey(tileId)) { @@ -507,12 +506,6 @@ public class RoutingContext { return tileId; } - private long maxMemory() { - // AVIAN FIXME -// return Runtime.getRuntime().maxMemory(); - return 0; - } - public boolean checkIfMemoryLimitCritical(long memoryLimit) {