弱可达状态(软引用),
软可达状态(弱引用),
幻可达状态(幻引用).
那位仁兄能帮忙清楚地解释一下这些概念,最好能给出原码实例.
19 个解决方案
#1
我第一次听说这种概念
学习
学习
#2
就是 就是 没听说过
#3
sun的官方文档里看到的,感觉能理解一点,但又不是很清晰,所以想请教一下各位大虾.
#4
是设计模式的概念吧
#5
牛
#6
不是设计模式,是对象的生存周期的一些概念.
#7
好象没有这样了概念吧,生存周期没见过啊。
#8
能提供英文原文么?好像这样子用中文的话不是很好理解
我的书上没有
我的书上没有
#9
java.lang.ref
#10
niu
#11
state machine
#12
这好像是有限自动机理论中的概念,搂主在那里见到的?
#13
sun中国社区有一个视频将jvm内存管理的,讲的就是这些内容,只是我没怎么仔细看 :)
谁有兴趣自己去下来看看就是了.
谁有兴趣自己去下来看看就是了.
#14
强。。。。。
#15
有点印象,但是没有研究过...也许自己认为目前还不需要!
所以,楼主问了这样的问题.那我就和你们一起学习吧
所以,楼主问了这样的问题.那我就和你们一起学习吧
#16
Reference ?
PhantomReference ?
SoftReference ?
WeakReference ?
PhantomReference ?
SoftReference ?
WeakReference ?
#17
原文是这样的;
strong reachable;
An object is strongly reachable if it can be reached by some thread without traversing any reference objects.a newly-created object is strongly reachable by the thread that created it.
soft reachable:
an object is softly reachable if it is not strongly reachable but can be reached by traversing a soft reference.
weak reachable:
an object is weakly reachable if it is neither strongly nor softly reachable but can be reached by traversing a weak reference.
phantom reachable;
an object is phantom reachable if it is neither strongly,softly nor weakly reahable,it has been finalized ,and some phantom reference refers to it.
strong reachable;
An object is strongly reachable if it can be reached by some thread without traversing any reference objects.a newly-created object is strongly reachable by the thread that created it.
soft reachable:
an object is softly reachable if it is not strongly reachable but can be reached by traversing a soft reference.
weak reachable:
an object is weakly reachable if it is neither strongly nor softly reachable but can be reached by traversing a weak reference.
phantom reachable;
an object is phantom reachable if it is neither strongly,softly nor weakly reahable,it has been finalized ,and some phantom reference refers to it.
#18
牛,学无止境
#19
Soft references are for implementing memory-sensitive caches, weak references are for implementing canonicalizing mappings that do not prevent their keys (or values) from being reclaimed, and phantom references are for scheduling pre-mortem cleanup actions in a more flexible way than is possible with the Java finalization mechanism.
#20
#1
我第一次听说这种概念
学习
学习
#2
就是 就是 没听说过
#3
sun的官方文档里看到的,感觉能理解一点,但又不是很清晰,所以想请教一下各位大虾.
#4
是设计模式的概念吧
#5
牛
#6
不是设计模式,是对象的生存周期的一些概念.
#7
好象没有这样了概念吧,生存周期没见过啊。
#8
能提供英文原文么?好像这样子用中文的话不是很好理解
我的书上没有
我的书上没有
#9
java.lang.ref
#10
niu
#11
state machine
#12
这好像是有限自动机理论中的概念,搂主在那里见到的?
#13
sun中国社区有一个视频将jvm内存管理的,讲的就是这些内容,只是我没怎么仔细看 :)
谁有兴趣自己去下来看看就是了.
谁有兴趣自己去下来看看就是了.
#14
强。。。。。
#15
有点印象,但是没有研究过...也许自己认为目前还不需要!
所以,楼主问了这样的问题.那我就和你们一起学习吧
所以,楼主问了这样的问题.那我就和你们一起学习吧
#16
Reference ?
PhantomReference ?
SoftReference ?
WeakReference ?
PhantomReference ?
SoftReference ?
WeakReference ?
#17
原文是这样的;
strong reachable;
An object is strongly reachable if it can be reached by some thread without traversing any reference objects.a newly-created object is strongly reachable by the thread that created it.
soft reachable:
an object is softly reachable if it is not strongly reachable but can be reached by traversing a soft reference.
weak reachable:
an object is weakly reachable if it is neither strongly nor softly reachable but can be reached by traversing a weak reference.
phantom reachable;
an object is phantom reachable if it is neither strongly,softly nor weakly reahable,it has been finalized ,and some phantom reference refers to it.
strong reachable;
An object is strongly reachable if it can be reached by some thread without traversing any reference objects.a newly-created object is strongly reachable by the thread that created it.
soft reachable:
an object is softly reachable if it is not strongly reachable but can be reached by traversing a soft reference.
weak reachable:
an object is weakly reachable if it is neither strongly nor softly reachable but can be reached by traversing a weak reference.
phantom reachable;
an object is phantom reachable if it is neither strongly,softly nor weakly reahable,it has been finalized ,and some phantom reference refers to it.
#18
牛,学无止境
#19
Soft references are for implementing memory-sensitive caches, weak references are for implementing canonicalizing mappings that do not prevent their keys (or values) from being reclaimed, and phantom references are for scheduling pre-mortem cleanup actions in a more flexible way than is possible with the Java finalization mechanism.