library/roles/tomcat: Do not set the permgen max size if the JDK version is >= 8.

This commit is contained in:
Andrea Dell'Amico 2017-01-17 12:54:01 +01:00
parent 3a926d3080
commit 5ffd2eee27
3 changed files with 11 additions and 3 deletions

View File

@ -25,6 +25,7 @@ JAVA_OPTS="{{ item.java_gc_opts }} $JAVA_OPTS"
JAVA_OPTS="${JAVA_OPTS} {{ item.other_java_opts }}"
{% endif %}
{% if item.jmx_enabled is defined and item.jmx_enabled %}
# JMX settings
JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port={{ item.jmx_port | default('tomcat_m_jmx_port') }}"
{% if item.jmx_use_ssl is defined and item.jmx_use_ssl %}
JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.ssl=true"
@ -42,7 +43,6 @@ JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.authenticate=false"
{% if item.jmx_disable_additional_ports is defined and item.jmx_disable_additional_ports %}
JAVA_OPTS="${JAVA_OPTS} -XX:+DisableAttachMechanism -Dcom.sun.management.jmxremote.rmi.port={{ item.jmx_port }}"
{% endif %}
{% endif %}
{% if item.remote_debugging is defined and item.remote_debugging %}
# You will be able to use a java debugger on port {{ item.remote_debugging_port }}.

View File

@ -10,9 +10,10 @@ tomcat_pkgs:
tomcat_user: tomcat7
tomcat_max_threads: 200
tomcat_min_heap_size: 2048m
tomcat_permgen_defined: True
tomcat_heap_size: '{{ tomcat_min_heap_size }}'
tomcat_permgen_size: 512m
tomcat_java_opts: "-Xms{{ tomcat_min_heap_size }} -Xmx{{ tomcat_heap_size }} -XX:MaxPermSize={{ tomcat_permgen_size }}"
tomcat_java_opts: "-Xms{{ tomcat_min_heap_size }} -Xmx{{ tomcat_heap_size }}"
tomcat_java_gc_opts: "-XX:+UseConcMarkSweepGC"
#tomcat_other_java_opts: "-Djsse.enableSNIExtension=false"
tomcat_other_java_opts: ""

View File

@ -14,8 +14,15 @@ JAVA_HOME={{ jdk_java_home }}
{% endif %}
JAVA_OPTS="-server -Djava.awt.headless=true"
{% if jdk_default <= 7 %}
{% if tomcat_permgen_defined %}
{% if tomcat_permgen_size is defined %}
JAVA_OPTS="-XX:MaxPermSize={{ tomcat_permgen_size }} $JAVA_OPTS"
{% endif %}
{% endif %}
{% endif %}
{% if tomcat_java_opts is defined %}
JAVA_OPTS="{{ tomcat_java_opts }}"
JAVA_OPTS="{{ tomcat_java_opts }} $JAVA_OPTS"
{% endif %}
{% if tomcat_java_gc_opts is defined %}
JAVA_OPTS="${JAVA_OPTS} {{ tomcat_java_gc_opts }}"