The garbage collector moves valid blocks to the tail of the log, skips invalid or obsolete blocks, and erases them (see Figure 2).
垃圾收集器将有效块移动到日志的尾部,跳过无效或废弃块,并擦除它们(参见图 2)。
Therefore, if the garbage collector runs after this line, but before line //2, the object will not be reclaimed.
因此,如果垃圾收集器在该行之后(但在行 //2 之前)运行,该对象就不会被回收。
Therefore, if the collector runs before line //2 attaches a strong reference to the re-created object, the object is lost and wr.get() returns null.
因此,如果收集器在行 //2 在重新创建的对象上施加一个强引用之前运行,对象就会丢失, wr.get() 则返回 null 。
应用推荐