什么是ReservedCodeCacheSize和InitialCodeCacheSize? [英] What are ReservedCodeCacheSize and InitialCodeCacheSize?

查看:3137
本文介绍了什么是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位和64: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 Hotspot VM的(即时)编译器的选项。基本上它设置了编译器代码缓存的最大大小。

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)客户端VM警告:异常java.lang.OutOfMemoryError发生调度信号SIGINT到处理程序 - VM可能需要强行终止。

何时设置此选项?


  1. 当遇到Hotspot编译器失败时

  2. 减少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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆