In playing around with ttvfast-python, I think there might be a memory leak. Running once or a few times is fine. But when I use a minimization algorithm such as scipy.optimizie.minimize, the process grows to be several gigabytes! Similarly, I tried using emcee (Daniel Foreman-Mackey's MCMC algorithm) with multithreading, and each thread quickly grew to many gigabytes. By contrast, when I run these algorithms (scipy.optimize.minimize or emcee) without using ttvfast-python, they only take up about 70 MB. Is it possible that ttvfast-python is not clearing up all the memory properly after it runs TTVfast?
This has been fixed by adding PY_XDECREF calls to the end of the function, cleaning up the temporary list construction: 358f3b88c9041335adb9ec51b4c43c8e03113ff0
Original report: