English 中文(简体)
最终确定者能达到何种目标?
原标题:What if a finalizer makes an object reachable?

在 Java,finalize在即将收集垃圾时被打上物体(高于此条),这样当它无法收拾。 但是,如果最终确定者再次使目标得以实现,那么情况如何?

最佳回答

直到该物体再次无法收齐为止。

根据http://download-llnw.oracle.com/javase/6/docs/api/java/lang/Object.html#finalize%28%29”rel=“nofollow”>JavaDoc,定稿()将不再被称作。

问题回答

然后,该物体从基本上收集垃圾。 页: 1 寻找这一术语,而且你应当获得大量有趣的文章。 正如Jim提到的那样,一个重要的一点是,定稿人只能管理一次。

如果你仔细阅读了APIC的描述,你就会看到,定稿人能够再次获得反对。 标语在无法达到之前被弃置,但<条码>定型(<>/条码>赢得的标记不止一次。

因此,你不使用最终确定者。 (Well,许多原因之一)。

已经收集了这方面的资料。 我 look着眼,把它放在一起,但我认为它是一种幻觉。

Yep, PhantomReference:

在收集者确定其参比者可以另外收回后,先验的标语。 甲型六氯环己烷的参考文献通常用于以比 Java定稿机制可能更为灵活的方式安排预先清理行动。

实际上,它还有另一张通行证来检查和确保不再提及该物体。 由于无法在第二张通行证上进行这种测试,你最终不能为物体释放记忆。

由于最后定案仅指任何特定物体的单一时间,而下一个时间是没有参考文件时,它只会释放记忆而不要求最后审定。 http://www.codeguru.com/java/tij/tij0051.shtml“rel=“nofollow”>here。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签