Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Systems Interfaces & Deployment > Mathematica Sessions > Mathematica Session History > $HistoryLength >
Mathematica > Notebooks and Documents > Notebook Basics > Managing Computations in Notebooks > Mathematica Session History > $HistoryLength >

$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
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF