title: Using Java's ReferenceQueue
body: <p>Do <code>SoftReference</code> and <code>WeakReference</code> really only help when created as instance variables? Is there any benefit to using them in method scope?</p>
  
  <p>The other big part is <code>ReferenceQueue</code>. Besides being able to track which references are determined garbage, can <code>Reference.enqueue()</code> be used to forcibly register an object for garbage collection?</p>
  
  <p>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?</p>
  
  <pre><code>Object bigObject;
  public void dispose() {
      ReferenceQueue&lt;Object&gt; queue = new ReferenceQueue&lt;Object&gt;();
      WeakReference&lt;Object&gt; ref = new WeakReference&lt;Object&gt;(bigObject, queue);
      bigObject = null;
      ref.enqueue();
  }
  </code></pre>
  
  <p>(Imagine that Object in this case represents an object type that uses a lot of memory... like <code>BufferedImage</code> or something)</p>
  
  <p>Does this have any realistic effect? Or is this just a waste of code?</p>