Skip to content

Commit 0437a91

Browse files
authored
refactor: remove --skip-mem-check flag and memory check logic from import script, update related documentation and scripts (#35)
1 parent 97e976d commit 0437a91

3 files changed

Lines changed: 2 additions & 25 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ The [OpenStreetMap website](https://www.openstreetmap.org/export/) allows you to
126126

127127
| Dataset | original | filtered... | time taken | reduction | during import | imported | time taken | reduction |
128128
|------------|----------|-------------|------------|-----------|---------------|----------|------------|-----------|
129-
| Planet | 86 GB | 34 GB | 40 min | ~60% | ~250 GB | ~65 GB | ~11 h | ~25% |
129+
| Planet | 86 GB | 36 GB | 40 min | ~57% | ~250 GB | ~65 GB | ~11 h | ~25% |
130130
| Germany | 4.4 GB | 1.8 GB | 2 min | ~59% | ~14.4 GB | 3,81 GB | ~18 min | ~13% |
131131
| Netherland | 1.4 GB | 394 MB | 30 s | ~70% | ~2,69 GB | 705,7 MB | ~3 min | ~50% |
132132

scripts/import.sh

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ usage() {
1717
echo " --data-dir PATH Directory to store processed data (default: ./)"
1818
echo " --memory SIZE JVM heap size (default: 16g)"
1919
echo " --threads NUM Maximum number of import threads (default: half of CPU cores)"
20-
echo " -y, --skip-mem-check Skip memory availability check and warning prompt"
2120
echo " -h, --help Show this help message"
2221
echo ""
2322
echo "Examples:"
@@ -41,7 +40,6 @@ THREADS=""
4140
PBF_FILE=""
4241

4342
# Parse arguments
44-
SKIP_MEM_CHECK=false
4543
while [[ $# -gt 0 ]]; do
4644
case $1 in
4745
--jar-file)
@@ -60,10 +58,6 @@ while [[ $# -gt 0 ]]; do
6058
THREADS="$2"
6159
shift 2
6260
;;
63-
-y|--skip-mem-check)
64-
SKIP_MEM_CHECK=true
65-
shift
66-
;;
6761
-h|--help)
6862
usage
6963
;;
@@ -135,22 +129,6 @@ REQUESTED_MEM_GB=$(echo "$MEMORY" | sed 's/[^0-9]//g')
135129
echo "System memory: ${AVAILABLE_MEM_GB}GB available"
136130
echo "Requested heap: $MEMORY"
137131

138-
if [ "$SKIP_MEM_CHECK" = false ] && [ "$REQUESTED_MEM_GB" -gt "$AVAILABLE_MEM_GB" ]; then
139-
echo ""
140-
echo "⚠️ WARNING: Requested heap size ($MEMORY) exceeds available memory (${AVAILABLE_MEM_GB}GB)"
141-
echo " This may cause the process to be killed by the OOM killer."
142-
echo " Consider reducing heap size or adding more RAM."
143-
echo ""
144-
read -p "Continue anyway? (y/N): " -n 1 -r
145-
echo
146-
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
147-
echo "Import cancelled."
148-
exit 1
149-
fi
150-
elif [ "$SKIP_MEM_CHECK" = true ]; then
151-
echo "Skipping memory check (--skip-mem-check flag used)"
152-
fi
153-
154132
# Build JVM arguments with memory management optimizations
155133
JVM_ARGS="-Xmx$MEMORY -Xms$MEMORY"
156134
JVM_ARGS="$JVM_ARGS -XX:+UseG1GC"

scripts/update.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ local_pull_docker_image() {
103103
# LOCAL: Filters the full planet PBF file using the Paikka container.
104104
###
105105
local_filter_pbf() {
106-
log "LOCAL: Filtering PBF file (approx. 50 mins)"
106+
log "LOCAL: Filtering PBF file"
107107
sudo docker run --rm -v "$DOWNLOAD_DIR":/data "$DOCKER_IMAGE" prepare "/data/$PBF_INPUT_FILE" "/data/$PBF_FILTERED_FILE"
108108
}
109109

@@ -116,7 +116,6 @@ local_create_import_bundle() {
116116
--memory "$IMPORT_MEMORY" \
117117
--threads "$IMPORT_THREADS" \
118118
--data-dir "/import/" \
119-
--skip-mem-check \
120119
"/download/$PBF_FILTERED_FILE"
121120
}
122121

0 commit comments

Comments
 (0)