"Before Java 7u6 String.intern() was slow and not particularly efficient, nor was it tunable (and the internal String map was held in perm space). You were recommended to use your own WeakHashMap to create your own version of intern'ed strings. After Java 7u6 String.intern() is efficient, the map is now in the heap, and you can tune it's bucket size with -XX:StringTableSize= (default 1009 in Java 7, 60013 in Java 8)."