Fix memory pressure
This commit is contained in:
parent
96402228e3
commit
a26494b028
2 changed files with 11 additions and 6 deletions
|
|
@ -22,8 +22,8 @@ set -euo pipefail
|
||||||
# --demo only compute Bank + TCR, transit only (quick test)
|
# --demo only compute Bank + TCR, transit only (quick test)
|
||||||
|
|
||||||
# --- Defaults ---
|
# --- Defaults ---
|
||||||
THREADS=12
|
THREADS=8
|
||||||
HEAP=24g
|
HEAP=40g
|
||||||
NETWORK_DIR=property-data/r5-network
|
NETWORK_DIR=property-data/r5-network
|
||||||
OUTPUT_BASE=property-data/travel-times
|
OUTPUT_BASE=property-data/travel-times
|
||||||
R5_DIR=r5-java
|
R5_DIR=r5-java
|
||||||
|
|
@ -131,7 +131,7 @@ fi
|
||||||
echo ""
|
echo ""
|
||||||
echo "--- Starting batch computation ---"
|
echo "--- Starting batch computation ---"
|
||||||
DATA_DIR="$NETWORK_DATA_DIR" NETWORK_CACHE_DIR="$NETWORK_DIR" \
|
DATA_DIR="$NETWORK_DATA_DIR" NETWORK_CACHE_DIR="$NETWORK_DIR" \
|
||||||
java -Xmx"$HEAP" -cp "$OUT_DIR:$LIB_DIR/*" propertymap.App \
|
java -Xms"$HEAP" -Xmx"$HEAP" -cp "$OUT_DIR:$LIB_DIR/*" propertymap.App \
|
||||||
--postcodes property-data/arcgis_data.parquet \
|
--postcodes property-data/arcgis_data.parquet \
|
||||||
--places property-data/places.parquet \
|
--places property-data/places.parquet \
|
||||||
--output-dir "$OUTPUT_BASE" \
|
--output-dir "$OUTPUT_BASE" \
|
||||||
|
|
|
||||||
|
|
@ -34,8 +34,11 @@ public class Router {
|
||||||
private static final int DEPARTURE_TO_TIME = 8 * 3600 + 30 * 60; // 08:30
|
private static final int DEPARTURE_TO_TIME = 8 * 3600 + 30 * 60; // 08:30
|
||||||
private static final int MAX_TRIP_DURATION_MINUTES = 90;
|
private static final int MAX_TRIP_DURATION_MINUTES = 90;
|
||||||
|
|
||||||
/** R5 PathResult throws if destinations > 5000. Chunks must be smaller when recording paths. */
|
/**
|
||||||
private static final int PATH_MAX_DESTINATIONS = 5000;
|
* R5 PathResult throws if destinations > 5000. Chunks must be smaller when recording paths.
|
||||||
|
* Kept well below R5's limit to reduce per-chunk memory (fewer destinations = smaller PathResult).
|
||||||
|
*/
|
||||||
|
private static final int PATH_MAX_DESTINATIONS = 2000;
|
||||||
|
|
||||||
// Percentile indices in R5 result arrays (order must match task.percentiles in buildTask)
|
// Percentile indices in R5 result arrays (order must match task.percentiles in buildTask)
|
||||||
private static final int PERCENTILE_BEST = 0; // 5th percentile (transit only)
|
private static final int PERCENTILE_BEST = 0; // 5th percentile (transit only)
|
||||||
|
|
@ -383,7 +386,9 @@ public class Router {
|
||||||
|
|
||||||
if (recordPaths) {
|
if (recordPaths) {
|
||||||
task.includePathResults = true;
|
task.includePathResults = true;
|
||||||
task.nPathsPerTarget = 3;
|
// We only use the most common RouteSequence (see extractPaths), so 1 path
|
||||||
|
// per target is sufficient and cuts path memory by ~67% vs 3.
|
||||||
|
task.nPathsPerTarget = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
configureMode(task, mode);
|
configureMode(task, mode);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue