简体   繁体   English

XMX和GC日志最大堆大小有何不同?

[英]Xmx and gc log max heap size difference?


Need to know why there is difference between Xmx jvm startup parameter and gc log Max Heap size 需要知道为什么Xmx jvm启动参数gc日志最大堆大小之间存在差异
1563.749: [GC 1563.749: [ParNew: 226929K->11859K(235968K), 0.0605702 secs] 735329K->523980K( 1808832K ), 0.0616580 secs] 1563.749:[GC 1563.749:[ParNew:226929K-> 11859K(235968K),0.0605702秒] 735329K-> 523980K( 1808832K ),0.0616580秒]
java version - 1.5.0_06 Java版本-1.5.0_06
Also Xms == Xmx 也Xms == Xmx

-Xmx parameter specifies only the maximum heap size. -Xmx参数仅指定最大堆大小。 JVM is free to choose any size lower than that and it could dynamically change. JVM可以自由选择任何小于该大小的大小,并且可以动态更改。 You could also specify initial heap size via -Xms and if you set it equal to -Xmx presumably heap size shouldn't change much. 您也可以通过-Xms指定初始堆大小,如果将其设置为-Xmx,则堆大小应该不会有太大变化。

UPDATE: Now when you mentioned that you also have -Xms == -Xmx my answer above no longer applies. 更新:现在,当您提到您也有-Xms == -Xmx时,以上答案不再适用。 Looking at your numbers again it appears that they're actually pretty close: 再次查看您的数字,看来它们实际上非常接近:

1,792M = 1,835,008K

So looks like the reported discrepancy is just about 27M or just slightly over 1%. 因此,看起来报告的差异大约为2700万,或略高于1%。 Why is it concerning you? 为什么与您有关?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM