The script is being running through a Flask application http://flask.pocoo.org so it’s not a issue with Spyder.
I’m hosting this as an api to call so having it effectively bomb out after a few calls isn’t handy at all, so far my only option is to write a cron job to kill the process and restart it, but that’s basically making the api useless as it could cut out when it’s running a job.
Frustrating that trying to force garbage collection doesn’t seem to help.