I was recently reading about all the JVM arguments available in JRE 6 [Java VM Options] and saw this :
-XX:+StringCache : Enables caching of commonly
I believe when used with -XX:+AggressiveOpts
it enables the same String
objects to be returned when creating the String
with the same text (though not through new String
, of course). There is a profile phase where a cache is build up, and after a point the cache is switched to read only. It gets higher scores in certain benchmarks.