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


$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.
See Also
Tech Notes
Related Workflows
- Limit the Amount of History Stored in the System
History
Introduced in 1996 (3.0)
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_2025_$historylength, author="Wolfram Research", title="{$HistoryLength}", year="1996", howpublished="\url{https://reference.wolfram.com/language/ref/$HistoryLength.html}", note=[Accessed: 08-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_$historylength, organization={Wolfram Research}, title={$HistoryLength}, year={1996}, url={https://reference.wolfram.com/language/ref/$HistoryLength.html}, note=[Accessed: 08-August-2025]}