JVM minimum heap size recommendation reasons?

扶醉桌前 提交于 2019-12-24 03:48:34

问题


BEA recommends to keep both min and max heap sizes same. They didn't elaborate the reason for the suggestion. Can someone provide details?

I also got another recommendation from an architect of not setting anything for minimum and just set the maximum. Any comments on this? If i dont use it, what would be the default?

What is the best tool to monitor and tune JVM settings. I am using JDK1.6, on BEA weblogic 10g. It is on Linux 32bit JVM.

Is Max heap size set to 2GB any good? Server has lots of RAM. Currently it is set at 1.5GB, and it is at 80% usage when there is 40 concurrent users. Thanks,


回答1:


When the JVM needs to increase the size of the heap it will invoke a full garbage collection which may reduce throughput or cause a pause, so I would think that this is recommended by them for performance reasons.

Default value is documented as 2MB so if you don't override it you are likely to get a lot of (probably very quick) full collections after starting up as the heap is frequently resized.

Unless you are trying to keep the memory footprint as small as possible, I would follow BEA's advice.

Impossible to say from the information given if 2GB is appropriate, or if the objects that are using up space in it are still in scope - the old generation will just gradually fill up until it runs out of space when a full collection will be invoked. Where does that 80% figure come from?

Use the following JVM arguments to log GC details to a file called gc.log:

-verbose:gc -XX:+PrintGCDetails -Xloggc:gc.log 

Then you can analyse this using something like http://www.tagtraum.com/gcviewer.html



来源:https://stackoverflow.com/questions/7382132/jvm-minimum-heap-size-recommendation-reasons

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!