This is documentation for Mathematica 7, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

$HistoryLength

$HistoryLength
specifies the number of previous lines of input and output to keep in a Mathematica session.
  • Values of In[n] and Out[n] corresponding to lines before those kept are explicitly cleared.
  • Using smaller values of $HistoryLength can save substantial amounts of memory in a Mathematica session.
The default is to save the entire history:
Change the setting to save no history:
This means the previous input can no longer be used directly:
By assigning to a variable you can still refer to previous results:
The default is to save the entire history:
In[1]:=
Click for copyable input
Out[1]=
 
Change the setting to save no history:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
This means the previous input can no longer be used directly:
In[3]:=
Click for copyable input
Out[3]=
By assigning to a variable you can still refer to previous results:
In[4]:=
Click for copyable input
Out[4]=
In[5]:=
Click for copyable input
Out[5]=
New in 3