Using Java's ReferenceQueue
Do SoftReference and WeakReference really only help when created as instance variables? Is there any benefit to using them in method scope? The other big part is ReferenceQueue . Besides being able to track which references are determined garbage, can Reference.enqueue() be used to forcibly register an object for garbage collection? For example, would it be worth to create a method that takes some heavy memory resources (held by strong references) in an object and creating References to enqueue them? Object bigObject; public void dispose() { ReferenceQueue<Object> queue = new ReferenceQueue