ActivitySim / activitysim

An Open Platform for Activity-Based Travel Modeling
https://activitysim.github.io
BSD 3-Clause "New" or "Revised" License
189 stars 96 forks source link

Unpredictable and sporadic memory release #850

Open i-am-sijia opened 2 months ago

i-am-sijia commented 2 months ago

Describe the bug Memory usage pattern can vary drastically when running the same model using the same code base on the same machine. For example, sometimes memory stacks up between mandatory tour scheduling segments (also observed in trip destination), sometimes it does not. Some times memory does not get released after a component is done before the next one starts.

This behavior is observed in more than one example model, also with more than one version of code base. So it seems to be not specific to a model or a version of code.

However, this seems to happen only in the Sharrow mode.

Below is an example of two model runs that are identical in everything except for memory pattern.

memory comp

To Reproduce Steps to reproduce the behavior:

  1. Use the latest ActivitySim code
  2. Run in sharrow mode
  3. Run the full scale example MTC model
  4. Repeat

Expected behavior It's desirable to have predictable and stable memory release.