After working with obj after this if block, you should set obj to null to enable the garbage collector to reclaim this object to take full advantage of weak references.
在使用这个if块之后的obj之后,您应该将ob j设置为null,从而让垃圾收集器能够回收这个对象以充分利用弱引用。
As long as the obj reference exists, the garbage collector will never free the storage used to hold the object.
只要ob j引用还存在,垃圾收集器就永远不会释放用来容纳该对象的存储空间。
应用推荐