Added garbage collection to stem multiprocessing issue