These maps hold weak references to allow tracked objects like connections to be garbage collected when they are referenced only by the aspect.
这些图持有弱引用,允许连接这样的被跟踪对象在只有方面引用它们的时候,被垃圾收集掉。
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.
在纯垃圾收集系统中,循环引用问题不大:若涉及到的两个对象中的一个对象被任何其他对象引用,那么这两个对象都将被垃圾收集。
Unfortunately, an associated downside to increased heap size is a corresponding increase in the amount of time needed to find and process objects that should be garbage collected.
遗憾的是,增加堆大小的一个缺点是查找和处理需要垃圾收集的对象所需的时间也会随之增加。
Reference objects themselves are subject to garbage collection and can be collected before the referent, in which case they are not enqueued.
Reference对象本身服从于垃圾收集,并且可在referent之前被收集,在这样的情况下,它们没有加入队列。
This prevents the Socket and User objects from being garbage collected, even though the application is never going to use either of them again.
这会阻止Socket和User对象被垃圾收集,即使应用程序不会再使用它们。
Memory Usage: Shows when objects are created, when they are garbage collected, and their size
内存使用情况: S可以显示什么时候对象被创建,什么时候它们被垃圾收集以及它们的大小。
Retain Forever: Objects with this lifetime are never garbage collected and are accessible to all threads.
RetainForever:具有此生存期的对象不进行垃圾收集并且所有线程都可以访问该对象。
Using WeakHashMap solves the problem of Thread objects not getting garbage collected, at some additional performance cost.
以一些额外的性能开销为代价,使用WeakHashMap解决了无法对Thread对象进行垃圾回收的问题。
Natives can create global references so that objects are not garbage collected until they are no longer needed.
本机可以创建一些全局引用,以保证对象在不再需要时才会被垃圾收集器回收。
Objects that listen for this event should keep a strong reference to their event handler to avoid it being garbage collected.
侦听此事件的对象应保留对其事件处理程序的强引用,以避免对它进行垃圾回收。
Objects that listen for this event should keep a strong reference to their event handler to avoid it being garbage collected.
侦听此事件的对象应保留对其事件处理程序的强引用,以避免对它进行垃圾回收。
应用推荐