Disposing BacktestEngine does not release all resources
cjdsellers opened this issue · comments
Chris Sellers commented
Bug Report
Expected Behavior
Calling engine.dispose()
should release all resources used by the engine, memory consumption of the engine should drop to near zero.
Actual Behavior
Analysis of memory shows that references are still being held onto, the theory is that this is due to actor and strategy state which do not clear their own resources when their on_reset
methods are not overridden.
Proposed fix
The dispose
method should be at least as thorough as calling reset
, and additionally force the Trader
to drop all actors, strategies and execution algorithms.
Chris Sellers commented
Now fixed from 34b2527.