This question already has an answer here:

By default $HistoryLength is set to \[Infinity]. This is often unnecessary and can cause unecessary memory usage. I can of course set $HistoryLength=n in each of my notebooks but is it possible change the default $HistoryLength?


marked as duplicate by Michael E2, Yves Klett, Mr.Wizard Jul 5 '15 at 18:45

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.