Java Heap Space Error

I’ve had Wildfire running for almost a year now. I’ve upgraded to 3.2.4. Sometime around 4 mos back the service got a bit wonky and I had to rebuild it using the LDAP association. That worked nicely for authentication however it hasn’t done anything for my increasingly frequent Java heap space error.

I’m quite clueless when it comes to the guts of java. I managed to get the heap space up to about 64 mb but most of the documentation I’ve seen stated that 64 was generally not enough.

The following errors come up

Exception in thread “btpool0-1” java.lang.OutOfMemoryError: Java heap space

at java.util.HashMap.newKeyIterator(Unknown Source)

at java.util.HashMap$KeySet.iterator(Unknown Source)

at java.util.HashSet.iterator(Unknown Source)

at sun.nio.ch.SelectorImpl.processDeregisterQueue(Unknown Source)

at sun.nio.ch.WindowsSelectorImpl.doSelect(Unknown Source)

at sun.nio.ch.SelectorImpl.lockAndDoSelect(Unknown Source)

at sun.nio.ch.SelectorImpl.select(Unknown Source)

at org.mortbay.io.nio.SelectorManager$SelectSet.doSelect(SelectorManager.java:299)

at org.mortbay.io.nio.SelectorManager.doSelect(SelectorManager.java:73)

at org.mortbay.jetty.nio.SelectChannelConnector.accept(SelectChannelConnector.java :120)

at org.mortbay.jetty.AbstractConnector$Acceptor.run(AbstractConnector.java:498)

at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)

29047707 http://SocketAcceptorIoProcessor-0.1 WARN org.apache.mina.common.support.DefaultExceptionMonitor - Unexpected exception.

java.lang.OutOfMemoryError: Java heap space

at java.util.HashMap.newKeyIterator(Unknown Source)

at java.util.HashMap$KeySet.iterator(Unknown Source)

at java.util.HashSet.iterator(Unknown Source)

at sun.nio.ch.SelectorImpl.processDeregisterQueue(Unknown Source)

at sun.nio.ch.WindowsSelectorImpl.doSelect(Unknown Source)

at sun.nio.ch.SelectorImpl.lockAndDoSelect(Unknown Source)

at sun.nio.ch.SelectorImpl.select(Unknown Source)

at org.apache.mina.transport.socket.nio.SocketIoProcessor$Worker.run(SocketIoProce ssor.java:500)

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

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

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

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

29050941 http://SocketAcceptorIoProcessor-0.1 WARN org.apache.mina.common.support.DefaultExceptionMonitor - Unexpected exception.

java.lang.OutOfMemoryError: Java heap space

29061098 http://SocketAcceptorIoProcessor-0.0 WARN org.apache.mina.common.support.DefaultExceptionMonitor - Unexpected exception.

java.lang.OutOfMemoryError: Java heap space

Exception in thread “btpool1-1” java.lang.OutOfMemoryError: Java heap space

32486804 http://SocketAcceptorIoProcessor-0.0 WARN org.apache.mina.common.support.DefaultExceptionMonitor - Unexpected exception.

java.lang.OutOfMemoryError: Java heap space

So what is the next path?

  1. How do you increase the java heap space?

  2. Do i need to dig into Garbage Collection?

  3. Is there an easy fix for this?

Thank you

This was answered on the doubled post above. Requires installing as service and changing the vmoptions file.

Thanks to WV for his help.

Hey gummibear,

Running the server as a service or not shouldn’t make much difference. The important part is to assign to the JVM the right amount of memory that your server needs to function properly (i.e. based on your load and setup). It is possible to set JVM parameters both when running as a service or not.

Regards,

– Gato

But there is still no where that this got answered as to how to change the heap space or where to go to get it. Please someone Private massage me with a little bit more detailed orentation as to how to do this. I have seen conflicting things about how Openfire.exe in the bin file goes to the openfired.exe and then runs the openfire or openfired.vmoptions and gets the -Xms512m -xmx1024m

I don’t get that part. one file named openfire.vmoptions controls an exe that extends the virual memory in java. There is where I feel there has to be something else.

I have already tried the openfire.vmoptions in teh bin folder where the exe’s are located. Nothing worked. It croked over dead in the water. Moved it out and it worked like a jewel to the nile river.

Otherwise drop me a message or email mew ith a URL or link with some walk through help cause I know nothing about Java period.

Its killing me though that its doing this with only 64 megs of VM Ram.

Thanks for your patients.

See this link:

http://www.igniterealtime.org/builds/openfire/docs/latest/documentation/install- guide.html#windows

Running Openfire in Windows → Custom Parameters

-Xms512m -xmx1024m
Case of the letters is possibly important. Try -Xms512m -Xmx1024m

Sweet - thank you.

Missed that part I guess. THANK YOU SO MUCH FOR YOUR HELP. Seems to be working like a nice diamond for right now. We will see over the weekend what might happen.

Have a great day and weekend.

Cheers.

-William L.

ps. Case is imporantant after all in this case.

haha.