diff --git a/tomcat-multiple-instances/defaults/main.yml b/tomcat-multiple-instances/defaults/main.yml index 911cb6b9..8dac1fa5 100644 --- a/tomcat-multiple-instances/defaults/main.yml +++ b/tomcat-multiple-instances/defaults/main.yml @@ -24,7 +24,7 @@ tomcat_m_restart_timeout: 300 # -server -Djava.awt.headless=true are always used. No need to specify them tomcat_m_java_opts_heap: "-Xms{{ tomcat_m_min_heap_size }} -Xmx{{ tomcat_m_heap_size }}" tomcat_m_java_opts_permgen: "-XX:MaxPermSize={{ tomcat_m_permgen_size }}" -tomcat_m_java_opts: "{{ tomcat_m_java_opts_permgen }}" +tomcat_m_java_opts: "" tomcat_m_java_gc_opts: "-XX:+UseConcMarkSweepGC" # Use "-XX:+UseConcMarkSweepGC" to enable the CMS garbage collector (improved # response time). If you use that option and you run Tomcat on a machine with diff --git a/tomcat-multiple-instances/templates/tomcat-default.j2 b/tomcat-multiple-instances/templates/tomcat-default.j2 index fbed83fa..b976b2a7 100644 --- a/tomcat-multiple-instances/templates/tomcat-default.j2 +++ b/tomcat-multiple-instances/templates/tomcat-default.j2 @@ -7,8 +7,16 @@ JAVA_HEAP="{{ item.java_heap }}" {% else %} JAVA_HEAP="{{ tomcat_m_java_opts_heap }}" {% endif %} +JAVA_PERMGEN= +{% if jdk_default <= 7 %} +{% if item.java_permgen_size is defined %} +JAVA_PERMGEN="-XX:MaxPermSize={{ item.java_permgen_size }}" +{% else %} +JAVA_PERMGEN="-XX:MaxPermSize={{ tomcat_m_permgen_size }}" +{% endif %} +{% endif %} {% if item.java_opts is defined %} -JAVA_OPTS="{{ item.java_opts }} $JAVA_OPTS $JAVA_HEAP" +JAVA_OPTS="{{ item.java_opts }} $JAVA_OPTS $JAVA_HEAP $JAVA_PERMGEN" {% endif %} {% if item.java_gc_opts is defined %} JAVA_OPTS="{{ item.java_gc_opts }} $JAVA_OPTS"