What are ReservedCodeCacheSize and InitialCodeCacheSize?(ReservedCodeCacheSize 和 InitialCodeCacheSize 是什么?)
问题描述
谁能解释一下JVM选项 ReservedCodeCacheSize 和 InitialCodeCacheSize 是什么?具体来说,我何时/为什么要更改它?如何确定合适的尺寸?
Can someone please explain what the JVM option ReservedCodeCacheSize and InitialCodeCacheSize are? Specifically when/why would I want to change it? How do I decide what the right size is?
这是文档所说的:
-XX:ReservedCodeCacheSize=32m 保留代码缓存大小(以字节为单位)- 最大代码缓存大小.[Solaris 64 位、amd64 和 -server x86:2048m;在 1.5.0_06 及更早版本中,Solaris 64 位和 and64:1024m.]
-XX:ReservedCodeCacheSize=32m Reserved code cache size (in bytes) - maximum code cache size. [Solaris 64-bit, amd64, and -server x86: 2048m; in 1.5.0_06 and earlier, Solaris 64-bit and and64: 1024m.]
推荐答案
ReservedCodeCacheSize(和 InitialCodeCacheSize)是(即时)编译器的一个选项Java 热点虚拟机.基本上它设置编译器代码缓存的最大大小.
ReservedCodeCacheSize (and InitialCodeCacheSize) is an option for the (just-in-time) compiler of the Java Hotspot VM. Basically it sets the maximum size for the compiler's code cache.
缓存可能已满,这会导致如下警告:
The cache can become full, which results in warnings like the following:
Java HotSpot(TM) 64-Bit Server VM warning: CodeCache is full. Compiler has been disabled.
Java HotSpot(TM) 64-Bit Server VM warning: Try increasing the code cache size using -XX:ReservedCodeCacheSize=
Code Cache [0x000000010958f000, 0x000000010c52f000, 0x000000010c58f000)
total_blobs=15406 nmethods=14989 adapters=362 free_code_cache=835Kb largest_free_block=449792
当出现 Java HotSpot(TM) Client VM 警告:异常 java.lang.OutOfMemoryError 将信号 SIGINT 分派给处理程序时,情况会更糟——VM 可能需要强制终止.
何时设置此选项?
- 当热点编译器失败时
- 减少 JVM 所需的内存(因此有 JIT 编译器失败的风险)
通常您不会更改此值.我认为默认值非常平衡,因为这个问题仅在极少数情况下发生(根据我的经验).
Normally you'd not change this value. I think the default values are quite good balanced because this problems occur on very rare occasions only (in my experince).
这篇关于ReservedCodeCacheSize 和 InitialCodeCacheSize 是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:ReservedCodeCacheSize 和 InitialCodeCacheSize 是什么?
基础教程推荐
- doFilter()是在servlet的工作完成之前还是之后执行的? 2022-01-01
- JPA惰性列表上的流 2022-01-01
- 如何在相机中应用自定义滤镜 [Surfaceview 预览]. 2022-01-01
- 在springboot中如何给mybatis加拦截器 2023-04-29
- 将 double 转换为 Int,向下舍入 2022-01-01
- 控制台应用程序中的 Java 键盘输入解析 2022-01-01
- 在java中使用xpath和selenium解析HTML表格数据 2022-01-01
- Maven:无效的目标版本:10 2022-01-01
- Java ECDSAwithSHA256 签名长度不一致 2022-01-01
- 将 Windows 证书导入 Java 2022-01-01
