Save Memory of Runtime by Freeing Unused Outputs

For now, in the runtime we save all the outputs, but actually some outputs can be freed after there are no steps that need those outputs. I wonder if it is okay to do that? I can submit a MR if you think this does not break anything.