这些图持有弱引用,允许连接这样的被跟踪对象在只有方面引用它们的时候,被垃圾收集掉。
These maps hold weak references to allow tracked objects like connections to be garbage collected when they are referenced only by the aspect.
引用队列是垃圾收集器向应用程序返回关于对象生命周期的信息的主要方法。
Reference queues are the garbage collector's primary means of feeding back information to the application about object lifecycle.
垃圾收集(GC)通过删除堆中其他任何对象不再引用的对象来回收一部分堆。
Garbage collection (GC) reclaims portion of the heap by removing objects not referenced by any other object in the heap.
除了垃圾收集之外,通常还有其他两种方法用于处理别名问题:引用计数和所有权管理。
Besides garbage collection, two other approaches are commonly used to deal with the problems of aliasing: reference counting and ownership management.
最直观的垃圾收集策略是引用计数。
The most straightforward garbage collection strategy is reference counting.
本机可以创建一些全局引用,以保证对象在不再需要时才会被垃圾收集器回收。
Natives can create global references so that objects are not garbage collected until they are no longer needed.
引用对象给垃圾收集过程带来了一些附加的成本。
Reference objects introduce some additional costs into the garbage collection process.
一些垃圾收集算法要求编译器或者运行时环境的重要配合,如当进行指针分配时更新引用计数。
Some garbage collection algorithms require significant cooperation from the compiler or runtime environment, such as updating reference counts whenever a pointer assignment is performed.
垃圾收集器然后根据当前收集所回收的内存总量和其他策略考虑因素,判断软引用此时是否需要被清除。
The garbage collector then assesses whether soft references need to be cleared at this time, based on the amount of memory reclaimed by the current collection and other policy considerations.
在这个被删除句柄范围中句柄引用的对象如果没有其他的引用的话,将在下一次的垃圾收集中被移除。
Objects referred to by handles within the deleted handle scope are eligible for removal in the next garbage collection if there are no other references to them.
每种引用对象都有不同的行为,而且它们与垃圾收集器之间的交互也有所不同。
Each type of reference object has different behaviors, and their interaction with the garbage collector varies.
如果对象的引用计数是零,那么它就是垃圾(用户程序不可到达它),并可以回收。
If an object's reference count is zero, it is garbage (unreachable from the user program) and can be recycled.
垃圾收集器的工作是发现应用程序不再需要的对象,并在这些对象不再被访问或引用时将它们删除。
The job of the garbage collector is to find objects that are no longer needed by an application and to remove them when they can no longer be accessed or referenced.
通常,持有可以丢弃的对象引用会减少生成的垃圾数量,但是这样会损害GC。
More generally, holding on to object references that could be discarded reduces the amount of generated garbage but tends to hurt GC.
弱引用告诉垃圾收集器如果某个对象除了弱引用之外没有其他任何引用,则应该收集该对象。
Weak references tell the garbage collector that it should collect an object if there are no references to it other than the weak reference.
在纯垃圾收集系统中,循环引用问题不大:若涉及到的两个对象中的一个对象被任何其他对象引用,那么这两个对象都将被垃圾收集。
In a purely garbage collected system, a circular reference is not a problem: If neither of the objects involved is referenced by any other object, then both are garbage collected.
创建全局引用时,JVM 会将它添加到一个禁止垃圾收集的对象列表中。
When the global reference is created, the JVM adds it to a list that excludes that object from garbage collection.
任何类只要不再被引用,它就符合垃圾收集的条件。
Any classes that are no longer being referenced are then eligible to be garbage collected.
当取消对类装入器的引用时,它装入的类就变成无法进行垃圾收集的了。
When the class loader is dereferenced, the classes that it loaded are not garbage collectable.
在同时使用了垃圾收集和引用计数的混合系统中,将会发生泄漏,因为系统不能正确识别循环引用。
In a hybrid system, where both garbage collection and reference counting are being used, leaks occur because the system fails to identify a circular reference.
由于垃圾收集有着特定的性质,所以引用类实际上可能没有您原来想像的那么有用,尽管如此,它们对于特定问题来说还是很有用的类。
They are useful classes for specific problems, although, due to the nature of garbage collection, they might not prove as useful as you originally thought.
与弱引用一样,软引用通过利用垃圾收集器在作出缓存回收决策方面的帮助,有助于防止应用程序出现对象游离。
Soft references, like weak references, can help applications prevent object loitering by enlisting the aid of the garbage collector in making cache eviction decisions.
引用类的主要功能就是能够引用仍可以被垃圾收集器回收的对象。
The main feature of the reference classes is the ability to refer to an object that can still be reclaimed by the garbage collector.
在使用这个if块之后的obj之后,您应该将ob j设置为null,从而让垃圾收集器能够回收这个对象以充分利用弱引用。
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.
垃圾收集器和引用交互。
赋值函数(mutator)和垃圾收集器可以共同工作以在创建老到年轻的引用时维护它们的完整列表。
The mutator and garbage collector can work together to maintain a comprehensive list of old-to-young references as they are created.
有几种垃圾收集的基本策略:引用计数、标记-清除、标记-整理 (mark-compact)和复制。
There are several basic strategies for garbage collection: reference counting, mark-sweep, mark-compact, and copying.
由于内部函数持有到外部函数的变量的引用,所以这个带属性a的范围对象将不会被垃圾收集。
Because the inner function holds a reference to the outer function's variables, the scope object with property a will not be garbage collected.
因为页面错误的成本很高,所以垃圾收集器正确管理引用的区域性(locality)是很必要的。
Because the cost of a page fault is high, it is desirable that a garbage collector properly manage locality of reference.
不过要这样做必须小心从事,因为这样可能会创建出一个循环引用,从而扰乱Lisp和。NET的垃圾收集器。
One has to be careful about doing this however, as it can create a circular reference that will interfere with both the Lisp and.net garbage collectors.
应用推荐