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.
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.