I have started to see the following error while live paper trading:
“Memory Usage Maxed Out - 512MB max, with last sample of 512MB. in Isolator.cs:line 179”
I am running hourly data resolution through the FundementalUniverseSelectionModel, utilizing both coarse and fine selection. The strategy initially filters on a few criteria (market, market cap, dollar volume, etc.), and then sorts based on the price/value ratio. I've tried to eliminate all excess memory usage. However, I am still running into this error.
During troubleshooting, I had the coarse selection function filter out all securities whose symbol did not begin with “A”. I wanted to drastically reduce the number of securities being evaluated. Annoyingly, this had minimal to no effect on memory usage. Am I fighting a losing battle here? Is the data coming in for the Fundemenental Universe already too large? I would be fine with trading on only half of the USA market if that would solve the memory issue (and if there is a way to implement this).
Nico Xenox
Hey Ethan Hammond,
try to mimize your universe and your historical request(if you have any) otherwise I would suggest to try out a higher live trading host.
Best,
Nico
Mia Alissi
Nico's suggestion to minimize the universe and historical requests is a good starting point. As mentioned in the documentation, each asset in the universe consumes approximately 5MB of RAM, so reducing the number of assets can help with memory usage.
To further reduce the number of securities being evaluated, you can try filtering your universe more aggressively in the
CoarseSelectionFunction
. For example, you can increase the minimum price or dollar volume thresholds. Here's an example of filtering based on dollar volume:You can also consider reducing the frequency of rebalancing or the number of historical requests if you have any, as Nico suggested.
If you still face memory issues after optimizing your algorithm, you may need to consider using a higher live trading host with more memory capacity. However, it's essential to optimize your algorithm first to ensure efficient usage of resources.
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Ethan Hammond
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!