powered by Jive Software

java.lang.OutOfMemoryError: Java heap space

My openfire server keeps flaking out. It will work fine for an hour maybe, then all of a sudden it’ll just “freeze”. No messages go through, never responds when I try to hit the web admin.

Here are the errors that are in my erro.log

java.lang.OutOfMemoryError: Java heap space

2008.02.01 16:30:45 org.jivesoftware.openfire.nio.ConnectionHandler.exceptionCaught(ConnectionHandle r.java:109)

java.lang.OutOfMemoryError: Java heap space

2008.02.01 16:30:45 org.jivesoftware.openfire.nio.ConnectionHandler.exceptionCaught(ConnectionHandle r.java:109)

java.lang.OutOfMemoryError: Java heap space

2008.02.01 16:30:45 org.jivesoftware.openfire.nio.ConnectionHandler.exceptionCaught(ConnectionHandle r.java:109)

java.lang.OutOfMemoryError: Java heap space

I’ve already tried to increase the heap space by adding the -Xmx###m flag. It’s at 512M now, and still acting flakey. There are only about 30 people that connect to this server with no plugins installed.

How can I fix this issue?

Hi,

do you see in the web admin console that Openfire can use 512 MB? For 30 users the default values should be fine.

LG

Yes. It shows in the web admin that it could use 512MB. upping it to 512MB didn’t work so it’s now set at 1024MB. It actually shows this in the admin console too. The default value has always been fine. It’s just since I upgraded that I’ve had this problem.

It still gets OutOfMemoryError even with 1024MB for the heap size.

If the default value should be fine for 30 users, then what can I do to fix this error?

It seems like this error is flooded in error.log until the server finally crashes.

I’ve deleted this user to see if their client is doing something to cause the server to use up so much memory. He is using the latest version Adium.

java.lang.IllegalArgumentException: IQ must be of type ‘set’ or ‘get’. Original IQ: <iq type=“result” id=“795-17” to=“jabber.swetesoc.comfrom="aj@jabber.swetesoc.com/aj-harriss-mac-pro"><query xmlns=“http://jabber.org/protocol/disco#info”><identity category=“client” type=“pc” name=“pidgin”/><feature var=“jabber:iq:last”/><feature var=“jabber:iq:oob”/><feature var=“jabber:iq:time”/><feature var=“xmpp:urn:time”/><feature var=“jabber:iq:version”/><feature var=“jabber:x:conference”/><feature var=“http://jabber.org/protocol/bytestreams”/><feature var=“http://jabber.org/protocol/disco#info”/><feature var=“http://jabber.org/protocol/disco#items”/><feature var=“http://jabber.org/protocol/muc”/><feature var=“http://jabber.org/protocol/muc#user”/><feature var=“http://jabber.org/protocol/si”/><feature var=“http://jabber.org/protocol/si/profile/file-transfer”/><feature var=“http://jabber.org/protocol/xhtml-im”/><feature var=“urn:xmpp:ping”/><feature var=“http://www.xmpp.org/extensions/xep-0199.html#ns”/><feature var=“http://jabber.org/protocol/mood”/><feature var=“http://jabber.org/protocol/moodnotify"/><feature var=“http://jabber.org/protocol/nick”/><feature var="http://jabber.org/protocol/nicknotify”/><feature var=“http://jabber.org/protocol/tune”/><feature var=“http://jabber.org/protocol/tunenotify"/><feature var=“http://www.xmpp.org/extensions/xep-0084.html#ns-metadata”/><feature var=“http://www.xmpp.org/extensions/xep-0084.html#ns-data”/><feature var=“http://www.xmpp.org/extensions/xep-0224.html#ns”/><feature var="http://www.xmpp.org/extensions/xep-0084.html#ns-metadatanotify”/><feature var=“http://jabber.org/protocol/commands”/></query></iq>

at org.xmpp.packet.IQ.createResultIQ(IQ.java:355)

at org.jivesoftware.openfire.disco.IQDiscoInfoHandler.handleIQ(IQDiscoInfoHandler. java:99)

at org.jivesoftware.openfire.handler.IQHandler.process(IQHandler.java:48)

at org.jivesoftware.openfire.IQRouter.handle(IQRouter.java:348)

at org.jivesoftware.openfire.IQRouter.route(IQRouter.java:100)

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

at org.jivesoftware.openfire.net.StanzaHandler.processIQ(StanzaHandler.java:303)

at org.jivesoftware.openfire.net.ClientStanzaHandler.processIQ(ClientStanzaHandler .java:78)

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

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

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

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:173)

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(ThreadPoolExecutor.java: 650)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)

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

at java.lang.Thread.run(Thread.java:595)

2008.02.04 08:39:31 org.jivesoftware.openfire.handler.IQHandler.process(IQHandler.java:68) Internal server error

After having this users account deleted for a couple of days, I’ve had absolutely no problems, so that second error seems to be the problem. This user needs an account and this can only be a temporary fix. Any ideas of what his client may be doing to cause this?

Same problem with openfire 3.4.5

Which version of Adium are you using? Do you see the problem again if you use Adium? I will try to reproduce it locally. Could you add -XX:+HeapDumpOnOutOfMemoryError to your command line when launching Openfire? That parameter will generate a heap dump of the JVM when the server crushes. I would need to see the generated file to see what’s going on.

Thanks,

– Gato