Java Memory 98%+

About a month and a half ago I updated the 3.6.3 version of Openfire to 3.7.1. The process of upgrading was flawless. Kudos to those who worked on the project and made it effortless to upgrade. After the upgrade I had to adjust the heap size for Java memeory (per http://www.igniterealtime.org/community/message/159780#159780). The server has been up and running since the upgrade. I noticed that every day the Java memory consumption was increasing in use. It has now reached and stays at 98% and maxes to 100% during normal operations. Currently it is at 100% with only 59 users connected (using Spark 2.6.3). The only plugin added to the system that is different than the 3.6.3 build is Jappix. I don’t have any users utilizing that service yet.

I don’t mind doing a maintenance reset once a month to keep the memory usage low. But, what can I do to keep the Java memory usage to a sustainable level?

Info on the current build:

OS: Ubuntu 10.4

Type: Virtual System on VMWare

Memory: 4G on system

Java Memory: Xms512m Xmx1024m

Average User Load: 100 - 150 users with a max of 200 possible

I am in the same boat, load wise here. Only diff is my current OF server is sitting on W2k3 server. My JVM stays pegged between 95-100% pretty much all the time. Server stays pretty stable though. Have had a few issues, but Ihave become accustomed to seeing that red meter when I first login.

I am in the process of migrating over to a new 64-bit linux server, but this time I am using MySQL as opposed to internal database. Whether that alleviates some of the JVM usage, time will tell.

did you set xmpp.pep.enabled to false? There is a known memory leak in many versions of Openfire.

1 Like

Embedded database and Monitoring plugin could be the reason, as database will grow rapidly by using this plugin and the embedded database is just a text file, so it is kept in the memory all the time.

Yea. I found this out the hard way :wink: But once I get this new machine rolling I think I will be in good shape.

I too have a similar problem. I have open fire running on Windows XP. It used to hang up once a month or so and now it hangs up two or three times a day. Although I am not including any logs, the error states Java memory heap. Is there a way for me to increase the Java memory? Thank you all for your support.

Hi David,

Is xmpp.pep.enabled located within Windows? If so, where can I find it?

It’s an Openfire property - Log into the admin web interface and go to ‘System Properties’ If it’s not there, then you can add it.

Thank you very much for your quick responce.

I’ve been trying to do the above mentioned but my server keeps saying Java memory heap therefore I am unable to login to the web interface. I trired numerous times to restart the server but to no avail.

You can set -Xmx1024m or some other value in the Openfire startup scripts. The Xmx parameter is for the JVM running Openfire. No idea which file on Windows you need to modify.

If windows, create a file under %openfire install dir%/bin called either:

openfire.vmoptions <== if starting as a normal app

openfire-service.vmoptions <== if starting OF as a service

Just a regular text file. In the text file you can put these two lines:

-Xms***N1***m

-Xmx***N2***m

Where ***N1 ***the minimum mem to allocate and ***N2 ***is the maximum memory to allocate to Java VM.

example:

-Xms1024m <1GB

-Xmx1550m <1.5GB

Then you will need to restart OF for these to take effect.

This did the trick for me.

Also, if Linux (Ubuntu here) and you installed from tarball, the openfire.vmoptions file may go under /opt/openfire/bin/

I have tried this but for some reason it still doesn’t want to work. Is there anything else I can do?

After dealing with the same thing you are seeing for some time I finally threw in the towel. I just could not get Openfire to any kind of stable condition. I had installed on Win2k3 using the internal database, with the Monitoring plugin installed. I think this was my problem (internal database with ~200 Users), but could never really pin down why the JVM would max out and eventually crash the server.

I built a new server using Ubuntu Linux Server 11.10 64-Bit with MySQL 5.1 and OpenFire 3.7.1 with the Monitoring plugin. Same user load (~200 Users) and where my Windows 2k3 box would sit between 95% and 99% JVM usage, this new one sits somewhere between 9% and 17% pretty much at all times.

Took some learning on my part, but now everything runs really nice.

Not sure that helps, but ended up being my final solution.

Tony

Okay. I think I will try this. Can you provide any insight on installing OF on Ubunto?

If you are using the embedded database with the Monitoring plugin, then consider trying just with MySQL database first. You don’t have to switch to Ubuntu for that.

The xmpp.pep.enabled set to false and a reboot fixed the issue. Thank you so much for the assistance.