title: JVM -XX:+StringCache argument?
body: <p>I was recently reading about all the JVM arguments available in JRE 6 [<a href="http://java.sun.com/javase/technologies/hotspot/vmoptions.jsp" rel="noreferrer">Java VM Options</a>] and saw this :</p>
  
  <blockquote>
    <p>-XX:+StringCache  : Enables caching of commonly allocated strings.</p>
  </blockquote>
  
  <p>Now I was always under the impression that Java kept a pool of interned (correct word?) Strings and when doing something like String concatenation with literals it was not creating new objects, but pulling them from this pool.  Has anyone ever used this argument, or can explain why it would be needed?</p>
  
  <p><strong>EDIT:</strong> I attempted to run a benchmark, to see if this argument had any effect and was unable to get the Sun JVM to recognize it.  This was with: </p>
  
  <pre><code>java version "1.6.0_11"  
  Java(TM) SE Runtime Environment (build 1.6.0_11-b03)
  Java HotSpot(TM) Client VM (build 11.0-b16, mixed mode,
  sharing)
  </code></pre>
  
  <p>So I'm not sure if this argument works at all.</p>