cleanup for the mem cache