Skip to content

Anirudh/s7 runtime and heap fixes - #60

Open
Anirudh-red11 wants to merge 8 commits into
agentsoz:mainfrom
Anirudh-red11:anirudh/s7-runtime-and-heap-fixes
Open

Anirudh/s7 runtime and heap fixes#60
Anirudh-red11 wants to merge 8 commits into
agentsoz:mainfrom
Anirudh-red11:anirudh/s7-runtime-and-heap-fixes

Conversation

@Anirudh-red11

@Anirudh-red11 Anirudh-red11 commented Aug 6, 2026

Copy link
Copy Markdown

Summary

  • Fixes the actual crash in SCSMidweekInJanScenario7IT: maven-failsafe-plugin had no /heap config at all (surefire had one, failsafe didn't), so IT tests ran with the JVM default heap and failed with a misleading EOFException/NPE instead of an OutOfMemoryError.
  • Adds scripts/reduce_population.py to shrink the population file and fix a person-id ordering issue Dhirendra flagged (ids were string-sorted, not numeric) used to generate reduced 20k/10k population files for faster local IT runs (the population files themselves are gitignored, not included here).
  • Cuts the midweek-in-jan matsim-config.xml qsim endTime from 23:59:59 to 16:00:00 to shorten simulated-day runtime.
  • Adds scripts/network_to_geojson.py plus generated network-links.geojson/network-nodes.geojson for the surf-coast-shire network, for visualizing the road graph in QGIS.

Still open

SCSMidweekInJanScenario7IT (unlike Scenario5IT) still fails on a separate, unrelated issue: an EditRoutes/disruption route-joining loop around simulated 09:00, tied to traffic-mgt-points.s3.json's impacted links and MATSim's within-day replanning. Diagnosed but not fixed, flagged to Dhirendra separately.

Test plan

  • SCSMidweekInJanScenario5IT passes locally (verified at 20k and 10k population)
  • SCSMidweekInJanScenario7IT still fails

Fixes the issue Dhirendra spotted: person ids in the demand file were
sorted alphabetically as strings (0,1,10,100,1000,...) rather than
numerically. Also lets us cut population size for faster dev-loop runs.
Generated with scripts/reduce_population.py from the original 40k demand
file. Not committing the .gz itself (matches the existing .gitignore
convention for demand-seasonal*.xml.gz in this folder) - regenerate with:
  python3 scripts/reduce_population.py \
    --input demand-seasonal-40k-50it-epsg32754-7886c91.xml.gz \
    --output demand-seasonal-20k-50it-epsg32754-7886c91.xml.gz \
    --max-agents 20000
Per Dhirendra: end the sim at 4pm instead of 23:59:59 to get closer to a
1-minute runtime. Fire ignites at 11:15 and the evacuate order goes out
at 12:15, so this still covers the full event with headroom.
The maven-failsafe-plugin (which actually runs the *IT.java integration
tests) had no argLine configured, so it forked with Java's default heap
instead of anything close to the surefire config below it. That's what
caused the EOFException/NullPointerException crash pattern on
SCSMidweekInJanScenario7IT - the forked JVM was getting killed, and
surefire/failsafe surfaced that as a misleading NPE at the Run.main()
call site rather than a real error.

Set -Xmx10g -Xms3g on both plugins: capped below what would risk the
OS killing the process on a 16GB machine, and starting small (3g) so it
only grows toward the cap if actually needed rather than eagerly
reserving the max up front.
For loading the road network directly into QGIS alongside the zones and
fire GeoJSON files already in scenarios/surf-coast-shire/.
Output of scripts/network_to_geojson.py against
surf-coast-shire-network-2021-epsg32754.xml.gz - 5187 nodes, 10145 links.
For visual QGIS work, not used by the simulation itself.
Second data point for the ~1min runtime target (per Dhirendra): try
halving the already-reduced 20k population down to 10k, generated
from the 20k file via scripts/reduce_population.py.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant