Limit the Amount of Session History
Reduce memory usage in a session by limiting the amount of history that is remembered.
The Wolfram System saves previous inputs and outputs for later reference using %, In and Out. By default, every previous input and output is saved. You can save substantial amounts of memory in a Wolfram System session by limiting the number of previous expressions it remembers.
Reduce the amount of session history that is saved
Set the Wolfram System to save no history:
Set the Wolfram System to remember the last two evaluations:
Restore saving session history
Return to saving all previous evaluations: