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`
ClearWeakCache
​
ClearWeakCache
[expr,key]
removes the given entry from the global weak hash table.
​
​
ClearWeakCache
[expr]
removes all key-value pairs associated with the expression
expr
.
​
​
ClearWeakCache
[]
removes all entries from the global weak hash table.
​
Details and Options

Examples  
(2)
Basic Examples  
(2)
In[1]:=
expr=Molecule[BioSequence["ATTGACA"]]
Out[1]=
Molecule
Formula:
C
69
H
87
N
27
O
39
P
6
Atoms:
228
Bonds:
245

In[2]:=
SetWeakCache
[expr,"adjacency matrix",expr["AdjacencyMatrix"]]
In[3]:=
CheckWeakCache
[expr,"adjacency matrix"]
Out[3]=
SparseArray
Specified elements: 490
Dimensions: {228,228}

In[4]:=
ClearWeakCache
[expr,"adjacency matrix"]
Out[4]=
True
In[5]:=
CheckWeakCache
[expr,"adjacency matrix"]
Out[5]=
$Failed
​
As with all functions in this paclet, it is important to note that even if two expressions are the same they may or may not point to the same underlying data.
In[1]:=
expr1=N@Range[10];​​
SetWeakCache
[expr1,"some key","some Value"]
In[2]:=
ClearWeakCache
[N@Range[10]]
Out[2]=
False
In[3]:=
expr2=expr1;​​ClearAll[expr1];​​
ClearWeakCache
[expr2]
Out[3]=
True
SeeAlso
WeakHashTable
 
▪
SetWeakCache
 
▪
CheckWeakCache
RelatedGuides
▪
Weak Cache Functions
""

© 2025 Wolfram. All rights reserved.

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