The following portion of code seems to cause a memory leak that gradually exhausts the research memory until the kernel restarts. longport is an array of ticker symbols. Can anyone explain this and provide a solution? Thank you very much.
buycosts = get_pricing(longport,start_date = monthlist.axes[0][i],end_date = monthlist.axes[0][i] + datetime.timedelta(days=3),fields = 'price') for position in longport:
buycosts[symbols(position)][0]