FlexSimPy Crashes After Repeated Simulation Runs in the Same Python Process
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I am using FlexSimPy to repeatedly run a FlexSim model from Python while modifying a few parameters between runs.
The simulation runs successfully at first, but after multiple iterations, FlexSim unexpectedly crashes and closes. The crash does not occur at a consistent iteration count; in my testing, it has occurred anywhere from around 4 runs to more than 30 runs. No Python exception or error message is reported when this happens.
The issue appears to be reproducible with the attached model and Python script.
Environment:
- FlexSim 2026
- Python 3.11
The only reliable workaround I have found is to start a completely new Python process for each simulation run. This avoids the crash, but significantly increases execution time because FlexSim must be restarted for every iteration.
Has anyone encountered a similar issue, or is there a recommended way to repeatedly execute simulations through FlexSimPy without restarting the process?
The attached model and Python script should reproduce the issue.
Thank you for your help.