Releasing memory in each cycle