powered by Jive Software

Openfire and memory

Hello all!

I have the latest openfire installed on my machine. I give it 196 mb of memory. But it very often dies. I have to restart the server every 3-4 days but there are only 2k visitors per day. How many memory should I give openfire to make it work fine? Or maybe there are some ways to optimize it (do not use persistent rooms, kick idle clients…). Please point me to the right direction.


196 MB with 2 000 visitors could be a bit too little. But you have tell how many users do you usually have logged in at one time. Also maybe they generate a lot of message traffic, maybe also sending files. It’s hard to say how much memory will be sufficient in every case. LG probably can give you a better advice. So far you can check his doc about the JVM settings http://www.igniterealtime.org/community/docs/DOC-1033

I dont quite understand what you mean by giving a memory. Is it virtual machine or are you settings some settings of the JVM? I would start with a gig of RAM with such user number, and a stripped linux box

Hi Max,

Not sure how properly this setting will scale, but I will give you an idea of how it works in my environment.

Generally have 50 users logged on at once and peak to 70 throughout the day. Our java memory usage usually hovers around 115 MB.

As part of our backup plan I run script that shutdowns the server everyday at 3 am and then copy the Openfire directory to backup media then start the server at 3:30 am. I am lucky enough to not have to provide 24 hour access and as a result I have a fresh start every morning and normally walk into about 70 MB of Java memory usage every morning. Hope this gives you a little idea of a baseline or thoughts towards restarting the server automatically every day or two.

Hi Joe,

does it die with OutOfMemory errors or does it start to use a lot of CPU? In any case it is a good idea to enable the GC log and tune also other JRE options.

As far as I can tell it’s not a memory leak if the allocated memory does increase a little bit, anyhow the allocated memory should decrease in the night to <50 MB.

Are you using an external database or the embedded one? The embedded database is held in memory and may cause OOM errors, not because of a memory leak but one should allow the server to use 500 MB or configure the database properly.


Mine used to die with out of memory errors, but tweaked Java to run at 256MB instead of the default (think it was 64MB) and have had zero problems since then. Max CPU load I ever see from the Openfire process is 9% and that is on a 2.0GHz desktop computer (one day I hope to move it to a VM Server). Like I said before, I have the luxury I know not everyone does of not needing 24 hour uptime. So I am able to knowingly reboot it everynight for maintenance. I’m sure this is not necessary but it seems to keep everything smooth throughout the business day.

Also sadly I am running the embeded database. I am by no means a database or software guy, have done very little of that in the past. Might try to tackle moving everything to a MySQL database when we transition to a real server.

Joe, i see the only good point in everyday restarting, it’s the complete backup. Though making backup while Openfire is running probably won’t hurt. We have ~200 users with ~150 average online. Linux box with Celeron 2.6 GHz and 256 MB of RAM, default JVM settings and it runs without restarts for months. I’m restarting my server only when i do Openfire update and this is not happening very often now Also, embedded-db is the simplest way for such a small userbase.