OutOfMemoryError in writeRequestQueue because of old version of mina in openfire and NIOConnection.java and SocketSessionImpl.java

Currenlty we are using openfire version 3.7.1 in our environment and getting OOME issue because of writeRequestQueue failing from mina library.

After analysis in openfire code it is found that the nature of this queue is unbounded which is causing the issue.

Analysing the mina , it is found that its actuallt an issue in old version of mina < 2.0.0. .

  1. · http://fisheye.igniterealtime.org/browse/openfire/tags/openfire_3_7_1/build/lib/ versions.txt?hb=true
  2. · http://fisheye.igniterealtime.org/browse/openfire/tags/openfire_3_8_1/build/lib/ versions.txt?hb=true

My question to openfire community is there any chance in future releases for upgradtion of mina jar to latest or version >2.0.0

OF-421 covers this, Guus had previously indicated to replace MINA with something else / more actively maintained…

Thanks Daryl for the reply.

Now we again got into OOME issue in our production environemnt.

The OOME issue is happening on the daily basis. We have setup JVM heap size to 1024 MB , i.e. -Xmx1024. We are running with about 1000+ concurrent users. The functioanlyty that openfire serves in our project is like -

  1. After every 1 min each user sends some information in XML format which is our project specific . Along with this data XML it also establishing its prescnce again. This user sends this packet to a single chatroom.

  2. So after every min openfire will get 1000+ packets simultanesoly per min .

  3. We have a consumer which is listening the chatroom and parsing this packets.

  4. So in all the openfire server will be bombarded with around 1000+ packets along with their presence wvery min or so.

  5. Also our user will always be connected to openfire , they never logout.

  6. This is casuing the openfire server to went OOME every day.

We analyzed the heap dump and its says like same **writeRequestQueue inside MINA **is failing.

Also some internal cache queue of openfire is failing.

TO fix this issue we have given following tries -

  1. Remove unused plugins including monitoring plugin , user serach plugin.

  2. set the following property - cache.username2roster.maxlifetime=86400000 (1 day)

cache.username2roster.size=33554432 (32 MB)

  1. xmpp pep is already false

All this measures doesnt give us success. We are still getting OOME.

We have some question as well -

Question 1 - Can we directly compile the latest mina code in openfire, i,e, replace the existing code of mina in openfire.jar?

Question2 - Are their any other properties that we are missing to set ?

Question3 - What is the best garbage collector settings? (is parallel GC will helps?)

Question4 - Are their any other cache setting need to add?

Please suggest some suitable solution for that. Any help will be greatly appreciated.

Waiting for your quick response.

Thanks,

Keshav