Increasing Tomcat Heap Size

余生颓废 提交于 2019-12-02 23:22:44

问题


I'm trying to increase the heap size of tomcat (so i can optimize GeoServer performance), what i did is:

  • Change the JAVA_OPTS values in tomcat default file to be:

JAVA_OPTS="-Djava.awt.headless=true –Xmx3072m -XX:MaxPermSize=512m"

  • Restart tomcat

When I checked JVM values is shows:

Free memory: 440.33 MB Total memory: 495.06 MB Max memory: 2969.62 MB

I'm not sure whether this good or not.


回答1:


-Xmx will set the maximum heap size. The the JVM will allocate more memory as needed up to that limit. If you, for some reason, want to allocate more memory for the heap at JVM start, use the -Xms option in addition to the -Xmx option.

See the Oracle docs for details.

Also, these options refer to RAM, so the HD space is not relevant.



来源:https://stackoverflow.com/questions/25591063/increasing-tomcat-heap-size

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