I've run into this before. I used this recipe (probably from @minrk) 

    def clear_cache(rc, dview):
        assert not rc.outstanding, "don't clear history when tasks are outstanding"
        rc.purge_results('all') #clears controller
        rc.results.clear()
        rc.metadata.clear()
        dview.results.clear()
        rc.history = []
        dview.history = []
        rc.session.digest_history.clear()