Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Primary Navigation

    • Cloud & Deployment
    • Core Language & Structure
    • Data Manipulation & Analysis
    • Engineering Data & Computation
    • External Interfaces & Connections
    • Financial Data & Computation
    • Geographic Data & Computation
    • Geometry
    • Graphs & Networks
    • Higher Mathematical Computation
    • Images
    • Knowledge Representation & Natural Language
    • Machine Learning
    • Notebook Documents & Presentation
    • Scientific and Medical Data & Computation
    • Social, Cultural & Linguistic Data
    • Strings & Text
    • Symbolic & Numeric Computation
    • System Operation & Setup
    • Time-Related Computation
    • User Interface Construction
    • Visualization & Graphics
    • Random Paclet
    • Alphabetical List
  • Using Paclets
    • Get Started
    • Download Definition Notebook
  • Learn More about Wolfram Language

WeakCache

Guides

  • Weak Cache Functions

Symbols

  • CheckWeakCache
  • CleanupAfter
  • ClearHistory
  • ClearWeakCache
  • CreateReference
  • SameInstanceQ
  • SetWeakCache
  • StrongReference
  • WeakHashTable
  • WeakReference
JasonB`WeakCache`
ClearHistory
​
ClearHistory
[]
clears all expressions from
In
and
Out
and resets
$Line
to zero.
​
Details and Options

Examples  
(1)
Basic Examples  
(1)
The following demonstrates the basic usage of
ClearHistory
:
In[1]:=
$HistoryLength=∞;
In[2]:=
initialMem=MemoryInUse[];
Assign a large list to a variable, keeping a reference to the output in the history. Note that ending the expression in a semicolon prevents the data from being printed in the notebook but does not stop it from being stored in
Out
.
In[3]:=
list=Range[10^8];
In[4]:=
ListQ[%]
Out[4]=
True
In[5]:=
MemoryInUse[]-initialMem
Out[5]=
800002144
Clearing the variable does not clear all the memory used by the list:
In[6]:=
list=.
In[7]:=
MemoryInUse[]-initialMem
Out[7]=
800003352
By clearing the history the memory is reclaimed:
In[8]:=
ClearHistory
[]
In[9]:=
MemoryInUse[]-initialMem
Out[9]=
-560
SeeAlso
CleanupAfter
 
▪
$HistoryLength
 
▪
In
 
▪
Out
RelatedGuides
▪
Weak Cache Functions
""

© 2025 Wolfram. All rights reserved.

  • Legal & Privacy Policy
  • Contact Us
  • WolframAlpha.com
  • WolframCloud.com