This prevents the finalizer from reclaiming other objects.
这会阻止终结器回收其他对象。
This means that no subclass of that class can declare a finalizer.
这意味着该类的任何子类都无法声明终结器。
An empty finalizer incurs this added overhead without any benefit.
空的终结器只会徒增这种系统开销,而没有一点好处。
If a destructor is present, rewrite that to be the class finalizer.
如果存在析构函数,则将其重写为类终结器。
An empty finalizer (which negates the effect of the superclass finalizer).
空的finalizer(它抵消超类finalizer的作用)。
FindBugs detects a number of questionable finalizer constructs, such as.
FindBugs检测很多有问题的finalizer构造,如。
For example, a new slot cannot be requested on a destructor or finalizer.
例如,无法在析构函数或终结器上请求一个新的槽。
This means that you should never do anything time-critical in a finalizer.
这意味着你不应该在终结方法中做任何时间为关键的事情。
You can create a finalizer for the class you're creating and declare it as final.
可以为所创建的类创建一个终结器并将它声明为final。
There is no guarantee when a finalizer will be run, or even if it will be run at all.
无法保证终结器将在何时运行,或者甚至它是否会运行。
A finalizer can use this method to resurrect itself or an object that it references.
终结器可以使用此方法使自己或引用的对象重新起用。
This technique should be considered for every non final public class that has a finalizer.
每一个含有终结方法的非终结公有类都应该考虑这个技术。
As a consequence, you should never depend on a finalizer to update critical persistent state.
结论就是:你从不该依赖终结方法来更新重要的持续状态。
The exploit is a variation of the well-known technique of using a finalizer for resurrecting an object.
该漏洞是使用终结器来恢复对象的著名技术的一种变体。
Providing a finalizer for a class can, under rare conditions, arbitrarily delay reclamation of its instances.
在很少的情况下,为一个类提供终结方法可能会随意地延迟它实例的回收。
method throws an IOException, then the stream will not be closed (until the garbage collector runs its finalizer).
但是如果 props.load()方法抛出一个IOException,那么流则不会被关闭(直到垃圾收集器运行其终结器)。
However I was misguided by some articles into implementing the Diposable pattern with a Finalizer in any case.
但是我被误导的一些文章,为实现在任何情况下,终结器的一次性模式。
A finalizer is an appropriate vehicle for performing this task, assuming the native peer holds no critical resources.
假设本地对等体不拥有重要的资源,终结方法是执行这个任务的合适工具。
It can take arbitrarily long between the time that an object becomes unreachable and the time that its finalizer is executed.
从对象变得不可访问开始到它的终结方法被执行结束,这中间的时间可以任意长。
If you are considering writing such a safety-net finalizer, think long and hard about whether the extra protection is worth the extra cost.
如果你正在考虑写这样一个安全网终结方法,要仔细思考这种额外的保护是否值得额外的代价。
When the zombie finalizer is called, it takes the object being finalized - referenced by this - and stores it in the static zombie variable.
在调用zombie终结器时,它获取被终结的对象(由this引用)并将它存储在静态zombie变量中。
The disadvantage of this approach is that the existence of the finalizer means that the object is kept alive longer than it otherwise would be.
此方法的缺点是,终结器的存在意味着对象的存活期比其他情况下更长。
NET Framework 4, by default, if a Task that has an unobserved exception is garbage collected, the finalizer throws an exception and terminates the process.
NET框架4,默认情况下,如果有一个例外是避人耳目垃圾收集任务,析构函数抛出异常并终止过程。
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.
终结器恢复即将被垃圾收集的能力无疑是终结机制工作方式的一种意外后果。
Analysis revealed that at the time of its death, the application had thousands of graphics objects on its finalizer queue just waiting to be finalized and reclaimed.
分析表明在程序死亡时,应用中的终结方法队列中有成千上万的图形对象在等待被终结并回收。
Additionally, the memory associated with the object is not garbage collected until after the finalizer is executed, which can increase the memory demands on the program.
另外,与对象相关的内存直到终止程序执行后才会回收,这样会使程序对内存的要求增加。
For example, depending on a finalizer to release a persistent lock on a Shared resource such as a database is a good way to bring your entire distributed system to a grinding halt.
例如,依赖一个终结方法来释放一个共享资源,例如数据库,的持续锁,很容易引起整个分布式系统突然当掉。
Note that the public class, Foo, has no finalizer (other than the trivial one it inherits from Object), so it doesn't matter whether a subclass finalizer calls super. finalize or not.
注意公有类Foo没有终结方法(除非它从object继承一个无关紧要的),因此子类的终结方法是否调用super .finalize是不重要的。
If a finalizer (final queue) is associated with a soft or weak reference, then only after the soft or weak reference is removed is the finalizer removed on the next GC pass that is run.
如果一个finalizer (final查询)与一个soft或weak引用相关,那么只有当这个soft或weak引用删除后,这个finalizer才会在所运行的下一个GCpass上被删除。
Unfortunately, the finalizer thread was running at a lower priority than another application thread, so objects weren't getting finalized at the rate they became eligible for finalization.
遗憾的是,终结方法线程的运行优先级要低于另一个应用线程,因此在另一个应用线程中的对象变得可以被终结时,它们不能被终结。
应用推荐