为什么在调用-XX:+ PrintFlagsFinal和-XX:+ PrintCommandLineFlags时MaxHeapSze的输出不同? [英] Why is output of MaxHeapSze different when calling -XX:+PrintFlagsFinal and -XX:+PrintCommandLineFlags?

查看:668
本文介绍了为什么在调用-XX:+ PrintFlagsFinal和-XX:+ PrintCommandLineFlags时MaxHeapSze的输出不同?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

就像问题一样,当我使用JVM选项-XX + PrintFlagsFinal运行程序时,我可以看到打印的MaxHeapSize如下:

Just like the question, when I run the program with JVM option -XX+PrintFlagsFinal, I can see the printed MaxHeapSize as below:

 bool MaxFDLimit                                = true            {product}
uintx MaxGCMinorPauseMillis                     = 4294967295      {product}
uintx MaxGCPauseMillis                          = 4294967295      {product}
uintx MaxHeapFreeRatio                          = 70              {product}
**uintx MaxHeapSize                              := 1044381696      {product}**
 intx MaxInlineLevel                            = 9               {product}
 intx MaxInlineSize                             = 35              {product}
 intx MaxJavaStackTraceDepth                    = 1024            {product}

当我使用JVM选项-XX + PrintCommandLineFlags运行相同的程序时,我可以看到MaxHeapSize为:

While when I run the same program with JVM option -XX+PrintCommandLineFlags, I can see the MaxHeapSize as :

-XX:InitialHeapSize=65192896 **-XX:MaxHeapSize=1043086336** -XX:+PrintCommandLineFlags -XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:-UseLargePagesIndividualAllocation -XX:+UseParallelGC 

您能告诉我为什么这两个不同吗?我以为他们应该一样.

Can you tell me why these two are different? I thought they should be the same.

推荐答案

由于对齐方式和人体工程学的调整,实际堆大小可能与用户在命令行中指定的大小不同.默认情况下,堆是2MB对齐的(请参阅collectorPolicy.cpp ).

The actual heap size may differ from what the user specified in the command line due to alignment and ergonomics adjustments. By default, the heap is 2MB aligned (see collectorPolicy.cpp).

1044381696是1043086336对齐2MB后的最终堆大小.

1044381696 is the final heap size after 2MB-alignment of 1043086336.

这篇关于为什么在调用-XX:+ PrintFlagsFinal和-XX:+ PrintCommandLineFlags时MaxHeapSze的输出不同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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