$HistoryLength

$HistoryLength
specifies the number of previous lines of input and output to keep in a Wolfram System session.

DetailsDetails

  • The default setting for $HistoryLength is Infinity.
  • 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 Wolfram System session.

ExamplesExamplesopen allclose all

Basic Examples  (2)Basic Examples  (2)

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]=
Introduced in 1996
(3.0)