Fix #3582
This commit is contained in:
parent
1d9515e199
commit
933bc1dddb
2 changed files with 9 additions and 11 deletions
|
@ -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);
|
||||||
|
|
|
@ -436,7 +436,7 @@ public class RoutingContext {
|
||||||
}
|
}
|
||||||
TLongIterator it = ts.iterator();
|
TLongIterator it = ts.iterator();
|
||||||
TLongObjectHashMap<RouteDataObject> excludeDuplications = new TLongObjectHashMap<RouteDataObject>();
|
TLongObjectHashMap<RouteDataObject> excludeDuplications = new TLongObjectHashMap<RouteDataObject>();
|
||||||
while(it.hasNext()){
|
while (it.hasNext()) {
|
||||||
getAllObjects(it.next(), toFillIn, excludeDuplications);
|
getAllObjects(it.next(), toFillIn, excludeDuplications);
|
||||||
}
|
}
|
||||||
timeToFindInitialSegments += (System.nanoTime() - now);
|
timeToFindInitialSegments += (System.nanoTime() - now);
|
||||||
|
@ -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) {
|
||||||
|
|
Loading…
Reference in a new issue