Try to clear some memory before saving state