-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Low
-
Affects Version/s: 5.2.11, 6.1.1, 7.6.6, 8.20.30, 9.12.9
-
Component/s: Installation
-
5.02
-
77
-
Severity 3 - Minor
-
17
Problem Summary
When shutting down Jira using it's built-in scripts ('stop-jira.sh', 'shutdown.sh' or 'catalina.sh stop'), the same memory allocation settings used by Jira will be read by the auxiliary Java process (org.apache.catalina.startup.Bootstrap) spun up to execute shutdown tasks.
If the lower boundary is set too high - sometimes equals to the upper boundary as recommended by Atlassian Support - it may not be able to execute as it will require effectively double the allocated memory available on the OS.
Expected Behavior
Use a lower, default memory allocation setup for the shutdown process separate to the one used by Jira's main Java process.
Actual Behavior
The shutdown process fails.
Steps to Reproduce
- Configure the memory settings for Jira so that the lower boundary is significantly more than half the available memory on the OS;
- Start Jira and shut it down subsequently;
Observe that the shutdown process will fail and throw an error similar to the following:
Java HotSpot(TM\) 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000680000000, 5368709120, 0\) failed; error='Cannot allocate memory' \(errno=12\) \# \# There is insufficient memory for the Java Runtime Environment to continue. \# Native memory allocation \(mmap\) failed to map 5368709120 bytes for committing reserved memory. \# An error report file with more information is saved as: \# /opt/jira/bin/hs_err_pid25290.log
Workaround
- Access Jira's <Jira_Installation>/bin/setenv.sh file.
- Locate, then remove the following lines:
JAVA_OPTS="-Xms${JVM_MINIMUM_MEMORY} -Xmx${JVM_MAXIMUM_MEMORY} ${JVM_CODE_CACHE_ARGS} ${JAVA_OPTS} ${JVM_REQUIRED_ARGS} ${DISABLE_NOTIFICATIONS} ${JVM_SUPPORT_RECOMMENDED_ARGS} ${JVM_EXTRA_ARGS} ${JIRA_HOME_MINUSD} ${START_JIRA_JAVA_OPTS}" export JAVA_OPTS - Add the following lines to the exact place from where we removed the old ones.
#--------------------------- Workaround for JRASERVER-35398 -------------------------------------------------------- # Taking into account Order of JAVA_OPTS and CATALINA_OPTS in startup: # # We set JVM XMX 2 times: # - generic, for Tomcat only through JAVA_OPTS # - specific for Jira, one more time through CATALINA_OPTS # # 512MB should be enough for Tomcat stop process TOMCAT_JVM_OPTS="-Xms512m -Xmx512m" JAVA_OPTS="${JAVA_OPTS} ${TOMCAT_JVM_OPTS} ${JVM_REQUIRED_ARGS} ${DISABLE_NOTIFICATIONS} ${JVM_EXTRA_ARGS} ${JIRA_HOME_MINUSD} ${START_JIRA_JAVA_OPTS} ${JVM_CODE_CACHE_ARGS} ${JVM_SUPPORT_RECOMMENDED_ARGS}" export JAVA_OPTS JVM_OPTS_CATALINA="-Xms${JVM_MINIMUM_MEMORY} -Xmx${JVM_MAXIMUM_MEMORY}" CATALINA_OPTS="${JVM_OPTS_CATALINA} ${CATALINA_OPTS}" export CATALINA_OPTS #-------------------------------------------------------------------------------------------------------------------
- Save the changes.
- Restart Jira.
- Repeat the process on the other nodes (if any).
- duplicates
-
JRASERVER-60869 Java Heap Settings and GC Logging should go into CATALINA_OPTS instead of JAVA_OPTS
- Closed
- mentioned in
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
- relates to
-
JDCUM-9 Loading...