JVM -XX:+StringCache argument?

后端 未结 6 1459
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-15 20:19

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

6条回答
  •  醉梦人生
    2020-12-15 20:43

    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.

提交回复
热议问题