The ability of a finalizer to revive an object destined for garbage collection is clearly an unintended consequence of the way that the finalization mechanism works.
终结器恢复即将被垃圾收集的能力无疑是终结机制工作方式的一种意外后果。
When using an object pool, the allocation, initialization, collection, and finalization only occur once, reducing both the memory usage and the processing time that is required.
在使用对象池时,分配、初始化、回收和终结只发生一次,从而减少了内存使用和所需的处理时间。
While executing in your finalization method during domain unloading, you might want to access another object that is referenced by a static field and has a finalization method.
在域卸载过程中执行终止方法时,您可能需要访问另一个由静态字段引用并且有终止方法的对象。
应用推荐