nautechsystems / nautilus_trader

A high-performance algorithmic trading platform and event-driven backtester

Home Page:https://nautilustrader.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Disposing BacktestEngine does not release all resources

cjdsellers opened this issue · comments

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.

Now fixed from 34b2527.