
Ephemerons - luu
http://mail.openjdk.java.net/pipermail/core-libs-dev/2016-January/038094.html
======
bsaul
"" Java already has 4 "weak" reference types with different "strengths":
SoftReference, WeakReference, Final reference and Phantom ""

Is it normal for a language to have that many types of weak references ??

~~~
joewalker
WeakReferences are elsewhere e.g. [1]

My understanding of SoftReferences is that they sound like they're going to be
useful in implementing caches, but then cacheing is hard, and generic
solutions like a SoftHashMap end up being toys. While they're are probably
cases where SoftReferences are useful, they're not common, hence they're not
elsewhere.

Phantom references are partly due to problems with the way finalize is
implemented in Java, and partly due to difficulties writing low level code in
a higher level language, hence they're slightly Java specific anyway.

[1]: [https://developer.mozilla.org/en-
US/docs/Web/JavaScript/Refe...](https://developer.mozilla.org/en-
US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap)

[https://community.oracle.com/blogs/enicholas/2006/05/04/unde...](https://community.oracle.com/blogs/enicholas/2006/05/04/understanding-
weak-references)

