title: Java 8 String deduplication vs. String.intern()
body: <p>I am reading about the feature in Java 8 update 20 for String deduplication (<a href="https://blog.codecentric.de/en/2014/08/string-deduplication-new-feature-java-8-update-20-2/" rel="noreferrer">more info</a>) but I am not sure if this basically makes <code>String.intern()</code> obsolete. </p>
  
  <p>I know that this JVM feature needs the G1 garbage collector, which might not be an option for many, but assuming one is using G1GC, <strong>is there any difference/advantage/disadvantage of the automatic deduplication done by the JVM vs manually having to <code>intern</code> your strings</strong> (one obvious one is the advantage of not having to pollute your code with calls to <code>intern()</code>)? </p>
  
  <p>This is especially interesting considering that Oracle might make G1GC the default GC in java 9</p>