弱引用和软引用
来源:互联网 发布:朱茵心机知乎 编辑:程序博客网 时间:2024/06/05 04:43
The difference between a {@code SoftReference} and a {@code WeakReference} is
the point of time at which the decision is made to clear and enqueue the
reference:
*
* <ul>
* <li>
* A {@code SoftReference} should be cleared and enqueued <em>as late as
* possible</em>, that is, in case the VM is in danger of running out of
* memory.
* </li>
* <li>
* A {@code WeakReference} may be cleared and enqueued as soon as is
* known to be weakly-referenced.
* </li>
* </ul>
the point of time at which the decision is made to clear and enqueue the
reference:
*
* <ul>
* <li>
* A {@code SoftReference} should be cleared and enqueued <em>as late as
* possible</em>, that is, in case the VM is in danger of running out of
* memory.
* </li>
* <li>
* A {@code WeakReference} may be cleared and enqueued as soon as is
* known to be weakly-referenced.
* </li>
* </ul>
*/
软引用和弱引用的差别在于决定清除和重置引用的时间点不同
软引用的清除和重置应该尽可能晚,这是为了防止vm处在内存溢出的环境中
弱引用的清除或者冲着应该在其被指明为若指引状态时就被清除和重置
0 0
- 强引用、弱引用和软引用
- 软引用、弱引用和虚引用
- 弱引用和软引用
- 转:强引用、软引用、弱引用和虚引用
- Java强引用、软引用、弱引用和虚引用
- Java强引用、软引用、弱引用和虚引用
- 强引用,软引用,弱引用和虚引用
- Java 对象引用:强引用、软引用、弱引用和虚引用
- android中四大引用的区别,强引用、软引用、弱引用和虚引用
- Java 的四大引用:强引用、软引用、弱引用和虚引用
- Java中的几种引用类型:强引用、软引用、弱引用和虚引用
- Java中的4种对象引用类型:强引用、软引用、弱引用和虚引用
- java中几种引用类型的定义和区别。强引用,软引用,弱引用,虚引用
- Java 的引用类型有哪几种:强引用、软引用、弱引用和虚引用
- Java和JNI中引用(强引用,软引用, 弱引用,虚引用)
- Java中的软引用,弱引用和虚引用
- Java中的软引用,弱引用和虚引用
- Java中的软引用,弱引用和虚引用
- 常用的正则表达式
- 有关 CentOS 6 的问题
- 解决面板里没有network manager图标的问题
- AM335x bootloader
- 使用vim看代码:cscope
- 弱引用和软引用
- 读取Excel的内容
- Vim+cscope+ctags+tags阅读源代码
- 硬盘安装CentOS 6.0(超级详细图文教程)
- 嵌套循环问题
- oracle数据库各版本现在地址
- 创建和使用Android Library工程
- SQL中Group By的使用
- 世界上最差的系统就是linux,双击不能安装软件