One of the most important things to implement when authoring a pool is a suitable object lifetime policy.
在创作池时需要实现的最重要的功能之一是适当的对象生存期策略。
To minimize the work required on a per-object basis, the default should minimize the objects for which you must specify the object lifetime.
为使针对平均每个对象所需执行的工作最小化,默认设置应使需要指定生存期的对象个数最少。
Most of the time, good software engineering techniques ensure that this happens automatically, without us having to expend a lot of attention on the issue of object lifetime.
在大多数时候,好的软件工程技术保证这是自动实现的,不用我们对对象生命周期问题花费过多心思。
This includes the control object lifetime behavior, in particular the handling of the described memory leak problem.
这包括控件对象生存期行为,特别是对所描述的内存泄漏问题的处理。
Whenever you can, avoid finalizers because of the additional performance overhead that is involved in tracking object lifetime.
应尽可能避免终结器,因为跟踪对象生存期会产生额外的性能系统开销。
The weak event pattern can also be used whenever the object lifetime of the source exceeds the useful object lifetime of the listener.
当源的对象生存期超出侦听器的有用对象生存期时,也可以使用弱事件模式。
You can also collect object lifetime data that shows you the size and number of objects that are reclaimed in each garbage collection generation.
您还可以收集对象生存期数据,这些数据显示每代垃圾回收中所回收的对象的大小和数目。
Whenever the source object lifetime extends beyond the object lifetime of the listener, the normal event pattern leads to a memory leak: the listener is kept alive longer than intended.
如果源对象生存期超出了侦听器的对象生存期,则常规事件模式会导致内存泄漏:侦听器保持活动状态的时间比预期要长。
Whenever the source object lifetime extends beyond the object lifetime of the listener, the normal event pattern leads to a memory leak: the listener is kept alive longer than intended.
如果源对象生存期超出了侦听器的对象生存期,则常规事件模式会导致内存泄漏:侦听器保持活动状态的时间比预期要长。
应用推荐