Always learning more about Openfire. Here are my current optional Java parameters.
Openfire is still my favorite XMPP server platform. The following configuration should serve for a moderately trafficked service:
These are set in $OPENFIRE_HOME/bin/openfire.
# Uncomment the following line to override the JVM search sequence INSTALL4J_JAVA_HOME=/usr/lib/jvm/java # Uncomment the following line to add additional VM parameters OPENFIRE_HOME=/opt/openfire INSTALL4J_ADD_VM_PARAMS="-server -Xms256m -Xmx2048m -XX:+UseG1GC -Dcom.sun.management.jmxremote"
Two important points about the above: (1) the “INSTALL4J” part comes from the program used to compile the service on Windows; (2) The VM_PARAMS include turning on the Garbage-First Garbage Collector (G1GC), which may be the most significant measure you can take to control memory leaks and generally tighten up memory management for any Java application.
Oracle says that G1GC is fully supported with Java 7, but it has been available as an experimental option since JDK 1.6.0_20. Opinion on the fora differs as to its suitability for production with Java 6. For me the security issues raised by the EOL of Java 6 in September of this year made it a moot point. I upgraded everything to 7 before implementing G1GC.