I'm looking for assistance improving efficiency and/or finding the memory leak in this algorithm. Note the `RAM` in the chart below is consistently trending upward with major spikes at various times. 

The algorithm itself is a relatively simple long-only strategy that buys at potential market bottoms. It uses `sklearn` to fit a Gaussian Mixture, then `scipy.stats` to sample from a distribution. The only thing saved between runs is the buy list which is a `np.ndarray`. The algo is scheduled to run twice weekly, resolution is hourly, history is `252*6.5` hours. 

Thanks guys.