$HistoryLength

$HistoryLength

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

Details

  • 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.

Examples

Basic Examples  (2)

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:

Wolfram Research (1996), $HistoryLength, Wolfram Language function, https://reference.wolfram.com/language/ref/$HistoryLength.html.

Text

Wolfram Research (1996), $HistoryLength, Wolfram Language function, https://reference.wolfram.com/language/ref/$HistoryLength.html.

CMS

Wolfram Language. 1996. "$HistoryLength." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/$HistoryLength.html.

APA

Wolfram Language. (1996). $HistoryLength. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/$HistoryLength.html

BibTeX

@misc{reference.wolfram_2021_$historylength, author="Wolfram Research", title="{$HistoryLength}", year="1996", howpublished="\url{https://reference.wolfram.com/language/ref/$HistoryLength.html}", note=[Accessed: 09-December-2021 ]}

BibLaTeX

@online{reference.wolfram_2021_$historylength, organization={Wolfram Research}, title={$HistoryLength}, year={1996}, url={https://reference.wolfram.com/language/ref/$HistoryLength.html}, note=[Accessed: 09-December-2021 ]}