title: When does 'Reference object' can be reclaimed?
body: <p>Now, I met a strange case likes that:</p>
  
  <pre><code>public class SoftRefDemo {
  
       private static List&lt;SoftReference&lt;String&gt;&gt; cache;
  
       public static void main(String[] args) {
           int total = 3000000;
           cache = new ArrayList&lt;SoftReference&lt;String&gt;&gt;(total);
           for (int i = 0; i &lt; total; i++) {
               cache.add(new SoftReference&lt;String&gt;("fafsfsfsdf" + i));
           }
  
           System.out.println(cache.size());
       }
  
  }
  </code></pre>
  
  <p>I have set the JVM setting:-Xms20m -Xmx40m. When I want to put many of SoftReference to cache, the JVM exit without any promption or exception. Actually, I am doubtful of the action of SoftReference, it's special object for JVM. Could anyone explains what's happen for this program?</p>
  
  <p><strong>Another two questions:</strong>
  1. Does there has extra memory allocation method for those 'special reference instance' in JVM heap?
  2. When does those reference instance can be freed when the instance that they pointer to has been freed? Thanks a lot!</p>