[an error occurred while processing this directive]
$HistoryLength specifies the number of previous lines of input and output to keep in a Mathematica session.
The default setting for $HistoryLength is Infinity.
Values of In[
] and Out[
] corresponding to lines before those kept are explicitly cleared.
Using smaller values of $HistoryLength can save substantial amounts of memory in a Mathematica session.
See the Mathematica book: Section 2.13.1.
See also: $Line.