Openfire 4.6.4 out of memory

Hi all,

We are using the 4.6.4 on product, but it will throw out of memory after running for a while. After dump the Java heap, we find there a lots of Deliverable objects in HttpSession.

Class Name                                              | Shallow Heap | Retained Heap | Percentage
----------------------------------------------------------------------------------------------------
java.util.ArrayList @ 0x7234c0c30                       |           24 |   533,759,760 |     20.37%
org.jivesoftware.openfire.http.HttpSession @ 0x75bd0dd58|          208 |   144,092,616 |      5.50%
org.jivesoftware.openfire.http.HttpSession @ 0x75bd0d3d0|          208 |   143,925,040 |      5.49%
org.jivesoftware.openfire.http.HttpSession @ 0x75bd0de40|          208 |   143,925,040 |      5.49%
org.jivesoftware.openfire.http.HttpSession @ 0x75bd0e248|          208 |   143,925,040 |      5.49%
org.jivesoftware.openfire.http.HttpSession @ 0x75bd0cf50|          208 |   143,924,912 |      5.49%
org.jivesoftware.openfire.http.HttpSession @ 0x75bd0e9b8|          208 |   143,841,176 |      5.49%
org.jivesoftware.openfire.http.HttpSession @ 0x75bd0eb88|          208 |   143,841,048 |      5.49%
org.jivesoftware.openfire.http.HttpSession @ 0x76014ee10|          208 |   143,841,048 |      5.49%
org.jivesoftware.openfire.http.HttpSession @ 0x760bcc718|          208 |   143,841,048 |      5.49%
org.jivesoftware.openfire.http.HttpSession @ 0x75bd0ccf0|          208 |   143,841,008 |      5.49%
org.jivesoftware.openfire.http.HttpSession @ 0x75bd0daf8|          208 |   143,757,312 |      5.49%
org.jivesoftware.openfire.http.HttpSession @ 0x75bd0ea88|          208 |   143,757,312 |      5.49%
org.jivesoftware.openfire.http.HttpSession @ 0x75bd106d0|          208 |   143,673,320 |      5.48%
org.jivesoftware.openfire.http.HttpSession @ 0x74c17aaa8|          208 |   143,589,456 |      5.48%
----------------------------------------------------------------------------------------------------

Class Name                                                                   | Shallow Heap | Retained Heap | Percentage
-------------------------------------------------------------------------------------------------------------------------
java.util.Collections$SynchronizedRandomAccessList @ 0x75bd0dd40             |           24 |   144,086,472 |      5.50%
'- java.util.ArrayList @ 0x730d2f2a8                                         |           24 |   144,086,448 |      5.50%
   '- java.lang.Object[1851] @ 0x79d03d9b0                                   |        7,424 |   144,086,424 |      5.50%
      |- org.jivesoftware.openfire.http.HttpSession$Deliverable @ 0x71f7db3c8|           24 |        83,864 |      0.00%
      |- org.jivesoftware.openfire.http.HttpSession$Deliverable @ 0x71f7db448|           24 |        83,864 |      0.00%
      |- org.jivesoftware.openfire.http.HttpSession$Deliverable @ 0x71f7db4c8|           24 |        83,864 |      0.00%
      |- org.jivesoftware.openfire.http.HttpSession$Deliverable @ 0x71f7db548|           24 |        83,864 |      0.00%
      |- org.jivesoftware.openfire.http.HttpSession$Deliverable @ 0x71f7db5c8|           24 |        83,864 |      0.00%
      |- org.jivesoftware.openfire.http.HttpSession$Deliverable @ 0x71f7db648|           24 |        83,864 |      0.00%
      |- org.jivesoftware.openfire.http.HttpSession$Deliverable @ 0x71f7db6c8|           24 |        83,864 |      0.00%
      |- org.jivesoftware.openfire.http.HttpSession$Deliverable @ 0x71f7db9d0|           24 |        83,864 |      0.00%
      |- org.jivesoftware.openfire.http.HttpSession$Deliverable @ 0x71f7dba50|           24 |        83,864 |      0.00%
      |- org.jivesoftware.openfire.http.HttpSession$Deliverable @ 0x71f7dbad0|           24 |        83,864 |      0.00%
      |- org.jivesoftware.openfire.http.HttpSession$Deliverable @ 0x71f7dbb50|           24 |        83,864 |      0.00%
      |- org.jivesoftware.openfire.http.HttpSession$Deliverable @ 0x71f7dbbd0|           24 |  

My question is why there are so many Deliverable objects in HttpSession. Can we delete these objects by any settings ?

Thanks,
Joe

This there a reason you are using this version versus the current release of 4.7.4 ? Your problem may just go away with a current release. There have been fixes since 4.6.4 to httpbind and memory management.

Hi Joe,

As akrherz suggested: try upgrading Openfire first.

These Deliverable instances keep track of the data to be sent to clients that are connected using HTTP-Binding/BOSH. If Deliverable stack up, then there might be misbehaving clients (that for some reason do not collect enough of the data that they’re being sent). What client software are you using?

Hi guus,

Sorry I miss you answer. We are using the strophe JS library as our client.

Thanks,
Joe

And BTW, do you have any sample code for strophe ? because we just use it as http bind function, other functions are all implement by Java code.

Thanks
Joe

I don’t have example code of how to use Strope, sadly. There are enough projects out there that use Strophe on Openfire with success, so I don’t expect that to be much of a problem.

I’m curious: If you’re using Java for all other functions, then why did you choose a Javascript library for the HTTP binding bit? Aren’t there Java libraries up to the task? Our own Smack library offers support (although I believe that in the current 4.4.6 release, that’s considered of ‘beta’ quality).

Hi guus,

I also confuse about this ( only use the Javascript for HttpBind ). Because I am the maintainer of this system, we will not change the framework too much now. So by now the best is upgrade openfire to 4.7.4, right ?

Hi guus,

Another question, do you have any work around to delete the pending items for version 4.6.4 ?

Joe

No, this problem is new to me. I’m not even sure if upgrading to the latest release will help - but I think it’s your best chance.