Set Java Memory in Openfire Container

Hi there, sorry about the basic question I know it’s been answered a million times, however I have been unable to find my specific answer.

I’m using this docker image:
https://hub.docker.com/r/nasqueron/openfire

I just moved the container and in the new environment I am seeing OOM errors shortly after startup. I’m trying to increase it from 512M and nowhere I put the configuration or java options seems to apply.

Can someone who understands openfire take a look at this image and help me find where to apply the options in a way that would have an impact.

Things I’ve tried:

  • Adding -Xms1024m -Xmx2048m the arguments to the docker run
  • Adding these parameters to env OPENFIRE_OPTS, and JAVA_OPTS
  • Adding these parameters to /etc/default/openfire

I have looked for the openfire/bin directory to create the two daemon files but I don’t see this directory.

I see the changes I have made in the environment, being used but when I check Java Memory in openfire dashboard it always shows 512M and it gets tacked out within minutes. We have a fairly large deployment IIRC.

Thank you!

As a workaround I’ve copied the entrypoint.sh for my version, updated to put the -Xms and -Xmx options before the startup.jar. That seems to have solved the problem for now.

Example: see -Xms4096m and -Xmx4096m :eyes:

# default behaviour is to launch openfire
if [[ -z ${1} ]]; then
  exec start-stop-daemon \
    --start \
    --chuid "${OPENFIRE_USER}:${OPENFIRE_USER}" \
    --exec /usr/bin/java -- \
      -server \
      -Xms4096m \
      -Xmx4096m \
      -Dlog4j.configurationFile="${OPENFIRE_DATA_DIR}/conf/log4j2.xml" \
      -DopenfireHome=/usr/share/openfire \
      -Dopenfire.lib.dir=/usr/share/openfire/lib \
      -classpath /usr/share/openfire/lib/startup.jar \
      -jar /usr/share/openfire/lib/startup.jar ${EXTRA_ARGS}
else
  exec "$@"
fi