Increasing Permanent Generation Memory Does Not Work

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

Changing JIRA_MAX_PERM_SIZE parameter in setenv.sh file does not have any effect on Permanent Generation Memory available in JIRA.

# Perm Gen size needs to be increased if encountering OutOfMemoryError: PermGen problems. Specifying PermGen size is not valid on IBM JDKs
JIRA_MAX_PERM_SIZE=256m
if [ -f "${PRGDIR}/permgen.sh" ]; then
    echo "Detecting JVM PermGen support..."
    . "${PRGDIR}/permgen.sh"
    if [ $JAVA_PERMGEN_SUPPORTED = "true" ]; then
        echo "PermGen switch is supported. Setting to ${JIRA_MAX_PERM_SIZE}"
        JAVA_OPTS="-XX:MaxPermSize=${JIRA_MAX_PERM_SIZE} ${JAVA_OPTS}"
    else
        echo "PermGen switch is NOT supported and will NOT be set automatically."
    fi
fi

Cause

The setenv.sh file have a script (permgen.sh) that check if a IBM VM is being used instead of a Sun VM.
If a "IBM" string is NOT found in $JAVA_HOME the parameter JAVA_PERMGEN_SUPPORTED is set to true, otherwise, is set to false preventing PermGen memory settings to be included in the JAVA_OPTS.

Workaround

Change the line:

JAVA_OPTS="-Xms${JVM_MINIMUM_MEMORY} -Xmx${JVM_MAXIMUM_MEMORY} ${JAVA_OPTS} ${JVM_REQUIRED_ARGS} ${DISABLE_NOTIFICATIONS} ${JVM_SUPPORT_RECOMMENDED_ARGS}"

to:

JAVA_OPTS="-Xms${JVM_MINIMUM_MEMORY} -Xmx${JVM_MAXIMUM_MEMORY} -XX:MaxPermSize=256m ${JAVA_OPTS} ${JVM_REQUIRED_ARGS} ${DISABLE_NOTIFICATIONS} ${JVM_SUPPORT_RECOMMENDED_ARGS}"

Resolution

This problem is due to an incorrectly set JAVA_HOME directory. See Installing Java. The root cause is due to a bug in JIRA, addressed in JRA-21159.

Last modified on Sep 5, 2022

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.