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 参数?
基础教程推荐
- Maven:无效的目标版本:10 2022-01-01
- JPA惰性列表上的流 2022-01-01
- 在java中使用xpath和selenium解析HTML表格数据 2022-01-01
- Java ECDSAwithSHA256 签名长度不一致 2022-01-01
- 控制台应用程序中的 Java 键盘输入解析 2022-01-01
- 在springboot中如何给mybatis加拦截器 2023-04-29
- doFilter()是在servlet的工作完成之前还是之后执行的? 2022-01-01
- 将 double 转换为 Int,向下舍入 2022-01-01
- 如何在相机中应用自定义滤镜 [Surfaceview 预览]. 2022-01-01
- 将 Windows 证书导入 Java 2022-01-01
