This commit is contained in:
Victor Shcherb 2020-06-10 22:58:18 +02:00
parent 1d9515e199
commit 933bc1dddb
2 changed files with 9 additions and 11 deletions

View file

@ -234,6 +234,7 @@ public class RoutePlannerFrontEnd {
if (intermediates != null) { if (intermediates != null) {
for (LatLon l : intermediates) { for (LatLon l : intermediates) {
if (!addSegment(l, ctx, indexNotFound++, points, false)) { if (!addSegment(l, ctx, indexNotFound++, points, false)) {
System.out.println(points.get(points.size() - 1).getRoad().toString());
return null; return null;
} }
} }
@ -364,7 +365,7 @@ public class RoutePlannerFrontEnd {
ctx.calculationProgress.segmentNotFound = indexNotFound; ctx.calculationProgress.segmentNotFound = indexNotFound;
return false; return false;
} else { } else {
log.info("Route segment found " + f.getRoad().id + " " + f.getRoad().getName()); log.info("Route segment found " + f.road);
res.add(f); res.add(f);
return true; return true;
} }
@ -383,6 +384,10 @@ public class RoutePlannerFrontEnd {
ctx.precalculatedRouteDirection = routeDirection.adopt(ctx); ctx.precalculatedRouteDirection = routeDirection.adopt(ctx);
} }
if (ctx.nativeLib != null) { if (ctx.nativeLib != null) {
ctx.startX = start.preciseX;
ctx.startY = start.preciseY;
ctx.targetX = end.preciseX;
ctx.targetY = end.preciseY;
return runNativeRouting(ctx, recalculationEnd); return runNativeRouting(ctx, recalculationEnd);
} else { } else {
refreshProgressDistance(ctx); refreshProgressDistance(ctx);

View file

@ -467,15 +467,14 @@ public class RoutingContext {
long h2 = runGCUsedMemory(); long h2 = runGCUsedMemory();
float mb = (1 << 20); float mb = (1 << 20);
log.warn("Unload tiles : estimated " + (sz1 - sz2) / mb + " ?= " + (h1 - h2) / mb + " actual"); log.warn("Unload tiles : estimated " + (sz1 - sz2) / mb + " ?= " + (h1 - h2) / mb + " actual");
log.warn("Used after " + h2 / mb + " of " + Runtime.getRuntime().totalMemory() / mb + " max " log.warn("Used after " + h2 / mb + " of " + Runtime.getRuntime().totalMemory() / mb );
+ maxMemory() / mb);
} else { } else {
float mb = (1 << 20); float mb = (1 << 20);
int sz2 = getCurrentEstimatedSize(); int sz2 = getCurrentEstimatedSize();
log.warn("Unload tiles : occupied before " + sz1 / mb + " Mb - now " + sz2 / mb + "MB " log.warn("Unload tiles : occupied before " + sz1 / mb + " Mb - now " + sz2 / mb + "MB "
+ memoryLimit / mb + " limit MB " + config.memoryLimitation / mb); + memoryLimit / mb + " limit MB " + config.memoryLimitation / mb);
long us2 = (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()); 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)) { if (!indexedSubregions.containsKey(tileId)) {
@ -507,12 +506,6 @@ public class RoutingContext {
return tileId; return tileId;
} }
private long maxMemory() {
// AVIAN FIXME
// return Runtime.getRuntime().maxMemory();
return 0;
}
public boolean checkIfMemoryLimitCritical(long memoryLimit) { public boolean checkIfMemoryLimitCritical(long memoryLimit) {