• 很明显,弱引用不再起作用。

    Clearly, the weak references are no longer working.

    youdao

  • 有时推荐的一个处理失效侦听器的方法是使用弱引用。

    One approach that is sometimes suggested for dealing with lapsed listeners is to use weak references.

    youdao

  • 比如说,WPF严重倚赖于弱引用来实现数据绑定技术。

    For example, it heavily relies on weak references for its data-binding technology.

    youdao

  • 如果已经分配了最低数量的对象,则对象的弱引用被放置到队列中。

    If the minimum number of objects is already allocated, then a weak reference to the object is enqueued.

    youdao

  • 以前的一篇文章“用弱引用堵住内存泄漏”给出了一些有用的技巧。

    A previous article, "Plugging memory leaks with weak references," offers some helpful techniques.

    youdao

  • 在这种情况下,解决办法就是也将链接列表中的链接更改 为弱引用。

    The solution in this case is to change the links in the linked list to also be weak references.

    youdao

  • 如以下示例所示,弱引用和软引用都是解决内存泄露的强大工具。

    As the following example shows, weak references and soft references are powerful tools for fixing memory leaks.

    youdao

  • 弱引用、软引用和虚引用允许灵活的缓存,能够改进应用程序的内存特性。

    Weak, soft, and phantom references can improve the memory characteristics of your application by allowing flexible caching.

    youdao

  • 在短周期对象销毁后,长周期对象对短周期对象的弱引用依然会长久保留下来。

    The weak reference from the long-lived object to the short-lived object is kept long after the short-lived object has been destroyed.

    youdao

  • 使用弱引用后,可以维持对referent的引用,而不会阻止它被垃圾收集。

    With weak references, you can maintain a reference to the referent without preventing it from being garbage collected.

    youdao

  • 请注意该方法如何用do -while循环来处理队列中可能存在的弱引用。

    Notice how this method accounts for possible weak references in the queue with the do-while loop.

    youdao

  • 弱引用有时会错误地用于取代软引用,用于构建缓存,但是这会导致差的缓存性能。

    Weak references are sometimes mistakenly used instead of soft references for building caches, but this will result in poor caching performance.

    youdao

  • 这些图持有弱引用,允许连接这样的被跟踪对象在只有方面引用它们的时候,被垃圾收集掉。

    These maps hold weak references to allow tracked objects like connections to be garbage collected when they are referenced only by the aspect.

    youdao

  • 而且,内存中的一个对象可以被多个引用(可以是强引用、软引用、弱引用或虚引用)引用。

    Furthermore, an object in memory can be referenced by multiple references that could be strong, soft, weak, or phantom. Before proceeding further, let's look at some terminology.

    youdao

  • 弱引用有两个构造函数:一个只取referent作为参数,另一个还取引用队列作为参数。

    Weak references have two constructors: one takes only the referent as an argument and the other also takes a reference queue.

    youdao

  • 弱引用告诉垃圾收集器如果某个对象除了弱引用之外没有其他任何引用,则应该收集该对象。

    Weak references tell the garbage collector that it should collect an object if there are no references to it other than the weak reference.

    youdao

  • 哪怕及时释放掉了实际的对象,但WPF的弱引用数组还是会继续持有引用,这就导致了内存泄漏。

    Even when the actual objects are being released in a timely manner, WPF's arrays of weak references hang around and under stress become the memory leak.

    youdao

  • 正如弱引用一样,软引用也可创建为具有一个相关的引用队列,引用在被垃圾收集器清除时进入队列。

    Just as with weak references, a soft reference can be created with an associated reference queue, and the reference is enqueued when it is cleared by the garbage collector.

    youdao

  • 如果有一种方法可以在弱引用的referent被垃圾收集时发出通知就好了,这就是引用队列的作用。

    It would be nice if there was a way to be notified when the referent of a weak reference is garbage collected, and that is what reference queues are for.

    youdao

  • WeakHashMap的实现展示了弱引用的一种常见用法——一些内部对象扩展WeakReference。

    The implementation of WeakHashMap illustrates a common idiom with weak references — that some internal object extends WeakReference.

    youdao

  • 可以通过周期性地扫描Map,对每一个弱引用调用get,并在get返回null时删除那个映射而消除死映射。

    Dead mappings could be eliminated by periodically scanning the map, calling get on each weak reference, and removing the mapping if get returns null.

    youdao

  • 与弱引用一样,软引用通过利用垃圾收集器在作出缓存回收决策方面的帮助,有助于防止应用程序出现对象游离。

    Soft references, like weak references, can help applications prevent object loitering by enlisting the aid of the garbage collector in making cache eviction decisions.

    youdao

  • 引用队列对于软引用来说,没有对弱引用那么有用,但是它们可以用于发出管理警报,说明应用程序开始缺少内存。

    Reference queues are not as useful with soft references as with weak references, but they could be used to raise a management alert that the application is starting to run low on memory.

    youdao

  • 鉴于弱引用看起来似乎是一个鲜为人知的特性,这里简要介绍下什么是弱引用,该如何使用以及何时应该使用他们。

    Since they seem to be a little-known feature, here is a brief overview of what weak references are, how to use them, and when to use them.

    youdao

  • 弱可及对象(weaklyreachable):不是强可及对象也不是软可及对象,并且能够通过弱引用访问的对象。

    Weakly reachable: an object that is not strongly or softly reachable and can be accessed through a weak reference.

    youdao

  • 在前一期文章中我们看到了,弱引用如何可以给应用程序提供当对象被程序使用时另一种到达该对象的方法,但是不会延长对象的生命周期。

    In the previous installment, we saw how weak references can provide an application with an alternate means of reaching an object while it is used by the program, but without prolonging its lifetime.

    youdao

  • 另一方面,在创建对一个对象的弱引用时,完全没有扩展referent的生命周期,只是在对象仍然存活的时候,保持另一种到达它的方法。

    On the other hand, when you create a weak reference to an object, you do not extend the lifetime of the referent at all; you simply maintain an alternate way to reach it while it is still alive.

    youdao

  • 弱引用和软引用都扩展了抽象的reference类(虚引用(phantomreferences)也一样,这将在以后的文章中介绍)。

    Weak and soft references both extend the abstract reference class (as do phantom references, which will be discussed in a future article).

    youdao

  • 用于存储键-值映射的Entry类型扩展了 WeakReference,因此当expungeStaleEntries()要求下一个失效的弱引用时,它得到一个 Entry。

    The Entry type, which is used to store the key-value mapping, extends WeakReference, so when expungeStaleEntries() asks for the next expired weak reference, it gets back an Entry.

    youdao

  • 处理软引用之后,弱可及对象的集合被识别——这样的对象上不存在强引用或软引用。

    After processing the soft references, the set of weakly reachable objects is identified — objects for which no strong or soft references exist.

    youdao

$firstVoiceSent
- 来自原声例句
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定