Out of memory error

We are encountering these error in our logs. Could someone out there have experience the following before ?

  1. 2016.02.22 06:07:19 org.jivesoftware.openfire.nio.ConnectionHandler - Closing connection due to exception in session:
    (0x0005644B: nio socket, server, null => 0.0.0.0/0.0.0.0:5222)

  2. java.lang.OutOfMemoryError: GC overhead limit exceeded

You are running out of memory for JVM (java virtual machine). GC (garbage collector) is part of JVM and does clean up of memory in time intervals. You can try increasing JVM parameters as per documentation (Custom Parameters) Openfire: Installation Guide

My current configuration is set at “OPENFIRE_OPTS=”-Xms1024m -Xmx1024m" when the error is observed. Now I have set it to “OPENFIRE_OPTS=”-Xms1024m -Xmx2048m". It should do the trick ?

First i don’t think having Xms same as Xmx is a good thing (not a Jave expert though). So you can try 512 and setting back Xmx to 1024. And i also know that Xmx can’t go to 2048 unless you are using 64-bit Java, so no point of setting it so high. I don’t know how to use Openfire with 64-bit Java though. Never needed, so never tried.

I am using the following Java:

root@openfire-1.mit.internal logs# java -version

java version “1.7.0_71”

Java™ SE Runtime Environment (build 1.7.0_71-b14)

Java HotSpot™ 64-Bit Server VM (build 24.71-b01, mixed mode)

What does Openfire show on the start page in Admin Console, which Java version in use? If there is jre folder inside Openfire installation folder, you can try stopping Openfire, renaming that folder to say old_jre and starting Openfire again, so it would use your system’s Java.

Java Version:
1.7.0_76 Oracle Corporation – Java HotSpot™ Server VM

it is using

Java Version:
1.7.0_76 Oracle Corporation – Java HotSpot™ Server VM

As you see it is not using the one you have installed on the system. It is using the included JRE and it is a 32-bit Java.