powered by Jive Software

java.lang.OutOfMemoryError: Java heap space for my plugin

I make the first plug-in and also can work after some testing. but openfire will pop the OutOfMemoryError when load my plug-in sometime. Anyone can help to where is wrong for loading plugin. Thanks.

My openfire memory config:

Uncomment the following line to override the JVM search sequence

INSTALL4J_JAVA_HOME_OVERRIDE="-Xms256m -Xmx1024m"

The error description:

[org.jivesoftware.openfire.container.PluginManager.loadPlugin(PluginManager.java :507)] Error loading plugin: /opt/openfire/plugins/webexlabseie
java.lang.OutOfMemoryError: Java heap space
at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:99)
at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:393)
at java.lang.StringBuilder.append(StringBuilder.java:120)
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:713)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:576)
at com.sun.org.apache.xerces.internal.util.SAXMessageFormatter.formatMessage(SAXMe ssageFormatter.java:94)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.setProperty(Abstra ctSAXParser.java:1849)
at org.dom4j.io.SAXHelper.setParserProperty(SAXHelper.java:34)
at org.dom4j.io.SAXReader.configureReader(SAXReader.java:911)
at org.dom4j.io.SAXReader.read(SAXReader.java:463)
at org.dom4j.io.SAXReader.read(SAXReader.java:264)
at org.jivesoftware.openfire.container.PluginManager.getElementValue(PluginManager .java:842)
at org.jivesoftware.openfire.container.PluginManager.getDatabaseKey(PluginManager. java:765)
at org.jivesoftware.database.SchemaManager.checkPluginSchema(SchemaManager.java:10 4)
at org.jivesoftware.openfire.container.PluginManager.loadPlugin(PluginManager.java :417)
at org.jivesoftware.openfire.container.PluginManager.access$300(PluginManager.java :47)
at org.jivesoftware.openfire.container.PluginManager$PluginMonitor.run(PluginManag er.java:1032)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:280)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:135)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101 (ScheduledThreadPoolExecutor.java:65)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodi c(ScheduledThreadPoolExecutor.java:142)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Schedu ledThreadPoolExecutor.java:166)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java: 650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)

I guess that you lock ressources and thus Openfire can not unload your plugin completely. You may want to attach a debugger to Openfire to see what’s going on.

LG

Can we look at the source code of your plugin to see what is going wrong? You have most likely introduced a memory leak somewhere. Alternatively, use a code analyzer (such as the excellent FindBugs) to inspect your code - perhaps it will tell you what the problem is.