JVM -XX:+StringCache argument?(JVM -XX:+StringCache 参数?)
问题描述
我最近在阅读 JRE 6 中可用的所有 JVM 参数 [Java VM选项]并看到了这个:
I was recently reading about all the JVM arguments available in JRE 6 [Java VM Options] and saw this :
-XX:+StringCache : 启用常用分配字符串的缓存.
-XX:+StringCache : Enables caching of commonly allocated strings.
现在我的印象是 Java 保留了一个实习(正确的词?)字符串池,并且在使用文字进行字符串连接之类的操作时,它不是创建新对象,而是将它们从该池中拉出.有没有人使用过这个论点,或者可以解释为什么需要它?
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?
我尝试运行基准测试,看看这个参数是否有任何影响,并且无法让 Sun JVM 识别它.这是与:
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:
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)
所以我不确定这个论点是否有效.
So I'm not sure if this argument works at all.
推荐答案
我找不到一个甚至可以接受这个假设参数的 JVM - 所以我想没什么好说的了.
I have not been able to find a single JVM that even accepts this supposed argument - so I guess there's not much else to say.
这篇关于JVM -XX:+StringCache 参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:JVM -XX:+StringCache 参数?
基础教程推荐
- 降序排序:Java Map 2022-01-01
- 无法使用修饰符“public final"访问 java.util.Ha 2022-01-01
- 减少 JVM 暂停时间 >1 秒使用 UseConcMarkSweepGC 2022-01-01
- FirebaseListAdapter 不推送聊天应用程序的单个项目 - Firebase-Ui 3.1 2022-01-01
- 在 Libgdx 中处理屏幕的正确方法 2022-01-01
- 设置 bean 时出现 Nullpointerexception 2022-01-01
- “未找到匹配项"使用 matcher 的 group 方法时 2022-01-01
- 如何使用 Java 创建 X509 证书? 2022-01-01
- Java:带有char数组的println给出乱码 2022-01-01
- Java Keytool 导入证书后出错,"keytool error: java.io.FileNotFoundException &拒绝访问" 2022-01-01