Wolfram Language
Paclet Repository
Community-contributed installable additions to the Wolfram Language
Primary Navigation
Categories
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
Create a Paclet
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`
W
e
a
k
R
e
f
e
r
e
n
c
e
W
e
a
k
R
e
f
e
r
e
n
c
e
[
.
.
]
r
e
p
r
e
s
e
n
t
s
a
r
e
f
e
r
e
n
c
e
t
o
a
n
e
x
p
r
e
s
s
i
o
n
w
h
i
c
h
d
o
e
s
n
o
t
e
n
s
u
r
e
t
h
e
e
x
p
r
e
s
s
i
o
n
i
s
k
e
p
t
i
n
m
e
m
o
r
y
f
o
r
t
h
e
l
i
f
e
t
i
m
e
o
f
t
h
e
r
e
f
e
r
e
n
c
e
.
W
e
a
k
R
e
f
e
r
e
n
c
e
[
.
.
]
[
]
r
e
t
u
r
n
s
t
h
e
r
e
f
e
r
e
n
c
e
d
e
x
p
r
e
s
s
i
o
n
.
D
e
t
a
i
l
s
a
n
d
O
p
t
i
o
n
s
Examples
(
1
)
Basic Examples
(
1
)
Create an object during and return a weak reference to it:
I
n
[
1
]
:
=
$
H
i
s
t
o
r
y
L
e
n
g
t
h
=
0
;
I
n
[
2
]
:
=
o
b
j
=
R
a
n
d
o
m
G
r
a
p
h
[
{
1
0
,
1
5
}
]
;
C
l
e
a
n
u
p
A
f
t
e
r
[
o
b
j
,
E
c
h
o
[
"
d
e
l
e
t
i
n
g
o
b
j
n
o
w
"
]
]
;
r
e
f
=
C
r
e
a
t
e
R
e
f
e
r
e
n
c
e
[
o
b
j
,
"
W
e
a
k
"
]
O
u
t
[
2
]
=
<
W
e
a
k
R
e
f
e
r
e
n
c
e
>
C
l
e
a
n
u
p
A
f
t
e
r
is used above to demonstrate when the underlying object is deleted from memory. Clearing the variable obj will delete all references to the data:
I
n
[
3
]
:
=
o
b
j
=
.
»
d
e
l
e
t
i
n
g
o
b
j
n
o
w
You can no longer retrieve the stored object using the weak reference:
I
n
[
4
]
:
=
r
e
f
[
]
O
u
t
[
4
]
=
F
a
i
l
u
r
e
M
e
s
s
a
g
e
:
T
h
e
r
e
f
e
r
e
n
c
e
h
a
s
e
x
p
i
r
e
d
.
T
a
g
:
E
x
p
i
r
e
d
R
e
f
e
r
e
n
c
e
S
e
e
A
l
s
o
C
r
e
a
t
e
R
e
f
e
r
e
n
c
e
▪
S
t
r
o
n
g
R
e
f
e
r
e
n
c
e
R
e
l
a
t
e
d
G
u
i
d
e
s
▪
W
e
a
k
C
a
c
h
e
F
u
n
c
t
i
o
n
s
"
"