Openfire 3.10.2 running on Raspbian Jessie hitting 100% CPU


I’ve recently moved my openfire 3.10.2 from a windows 2008R2 to a Raspberry pi 2 (Raspbian Jessie), migration went fine but for some reason, every couple hours java hits 100% CPU use.

pi@raspberrypi ~ $ top

top - 17:57:28 up 7:25, 3 users, load average: 1.98, 1.56, 1.21

Tasks: 106 total, 1 running, 105 sleeping, 0 stopped, 0 zombie

%Cpu(s): 59.8 us, 4.5 sy, 0.0 ni, 35.5 id, 0.1 wa, 0.0 hi, 0.1 si, 0.0 st

KiB Mem: 948120 total, 303276 used, 644844 free, 32192 buffers

KiB Swap: 102396 total, 0 used, 102396 free. 125508 cached Mem


581 openfire 20 0 752760 91976 13612 S 255.7 9.7 67:04.63 java

root@raspberrypi:/# java -version

java version “1.8.0”

Java™ SE Runtime Environment (build 1.8.0-b132)

Java HotSpot™ Client VM (build 25.0-b70, mixed mode)

Restarting the service does temporarily correct the issue, but it comes back a few hours after.

Any ideas ?



I think there is an issue with openfire and Debian/ubuntu based OS. I’ve been researching this a bit, and hope to build a debian/ubuntu server sometime soon to start testing. I just haven’t had alot of time. One of the things I was going to try was setting MALLOC_ARENA_MAX to something low, like 2 or 4.

The issue is clearly bound to java not properly closing network sockets when a client get disconnected (typically when people are connected via their phones through 3G/4G).

The whole java process freeze, the webUI is still reachable, but you can’t terminate any session from there.

I don’t think its all java. As you said, it ran fine for you on windows. I also run windows, and have not had any issues. Other user posted a few days ago that he switched from ubuntu to centos, and that resolved his problem. Anyway, I set up a test server over the weekend, and was able to get it to stop responding. After setting MALLOC_ARENA_MAX, I was able to workaround the issue.

Possible workaround for users experiencing high cpu or memory under linux

What value of MALLOC_ARENA_MAX did you use ?

I used 4