Openfire java process hits 100% CPU

When I restart the server, everything runs fine and it’s at low CPU usage, but inevitably something happens later on and the java process hits 100% CPU usage. The server still seems to be running fine (people are chatting, the admin console works, etc.) but the java process is using all of the CPU.

Restarting it fixes it temporarily.

My installation is as follows - I have a connection pool (just one connection manager on another machine right now) and MySQL is running on the same server that runs the java process, for now. I have no plugins installed. It’s running on AWS using Amazon Linux (similar to CentOS).

What can I do to find the cause of this?

Checking the error logs, I have some “Queue full” errors like this:

2012.12.21 20:07:48 org.jivesoftware.openfire.muc.spi.MultiUserChatServiceImpl - Internal server error

java.lang.IllegalStateException: Queue full

at java.util.AbstractQueue.add(Unknown Source)

at org.jivesoftware.openfire.muc.spi.MultiUserChatServiceImpl.logConversation(Mult iUserChatServiceImpl.java:1140)

at org.jivesoftware.openfire.muc.spi.LocalMUCRoom.broadcast(LocalMUCRoom.java:1130 )

at org.jivesoftware.openfire.muc.cluster.BroadcastMessageRequest$1.run(BroadcastMe ssageRequest.java:69)

at org.jivesoftware.openfire.muc.cluster.MUCRoomTask.execute(MUCRoomTask.java:85)

at org.jivesoftware.openfire.muc.cluster.BroadcastMessageRequest.run(BroadcastMess ageRequest.java:67)

at org.jivesoftware.openfire.muc.spi.LocalMUCRoom.broadcast(LocalMUCRoom.java:1100 )

at org.jivesoftware.openfire.muc.spi.LocalMUCRoom.send(LocalMUCRoom.java:998)

at org.jivesoftware.openfire.muc.spi.LocalMUCRoom.sendPublicMessage(LocalMUCRoom.j ava:973)

at org.jivesoftware.openfire.muc.spi.LocalMUCUser.process(LocalMUCUser.java:289)

at org.jivesoftware.openfire.muc.spi.LocalMUCUser.process(LocalMUCUser.java:194)

at org.jivesoftware.openfire.muc.spi.MultiUserChatServiceImpl.processPacket(MultiU serChatServiceImpl.java:321)

at org.jivesoftware.openfire.component.InternalComponentManager$RoutableComponents .process(InternalComponentManager.java:587)

at org.jivesoftware.openfire.spi.RoutingTableImpl.routeToComponent(RoutingTableImp l.java:352)

at org.jivesoftware.openfire.spi.RoutingTableImpl.routePacket(RoutingTableImpl.jav a:237)

at org.jivesoftware.openfire.MessageRouter.route(MessageRouter.java:105)

at org.jivesoftware.openfire.spi.PacketRouterImpl.route(PacketRouterImpl.java:80)

at org.jivesoftware.openfire.SessionPacketRouter.route(SessionPacketRouter.java:11 4)

at org.jivesoftware.openfire.SessionPacketRouter.route(SessionPacketRouter.java:72 )

at org.jivesoftware.openfire.multiplex.MultiplexerPacketHandler.route(MultiplexerP acketHandler.java:188)

at org.jivesoftware.openfire.net.MultiplexerStanzaHandler.processRoute(Multiplexer StanzaHandler.java:101)

at org.jivesoftware.openfire.net.MultiplexerStanzaHandler.processUnknowPacket(Mult iplexerStanzaHandler.java:109)

at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:305)

at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:194)

at org.jivesoftware.openfire.nio.ConnectionHandler.messageReceived(ConnectionHandl er.java:169)

at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.messageReceived (AbstractIoFilterChain.java:570)

at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Ab stractIoFilterChain.java:299)

at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilt erChain.java:53)

at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceive d(AbstractIoFilterChain.java:648)

at org.apache.mina.filter.codec.support.SimpleProtocolDecoderOutput.flush(SimplePr otocolDecoderOutput.java:58)

at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecF ilter.java:185)

at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Ab stractIoFilterChain.java:299)

at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilt erChain.java:53)

at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceive d(AbstractIoFilterChain.java:648)

at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java :239)

at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(Execut orFilter.java:283)

at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)

at java.lang.Thread.run(Unknown Source)

Please consider running a nightly build of openfire, I think you are hitting a bug with incorrect cache size calculations that is fixed in the trunk version.