关于openfire的内存溢出问题

来源:互联网 发布:java kettle api 编辑:程序博客网 时间:2024/04/29 23:26

我用openfire做为 IM服务器,项目测试时发现基本每过大约1天的时间就会产生内存溢出,导致用户登录不上去,内存溢出时,会在D:\Openfire\logs\生成一个日志文件stderr.log,内容是:

Exception in thread "Thread-5" java.lang.OutOfMemoryError: Java heap space
 at javax.swing.text.GapContent.allocateArray(Unknown Source)
 at javax.swing.text.GapVector.resize(Unknown Source)
 at javax.swing.text.GapVector.shiftEnd(Unknown Source)
 at javax.swing.text.GapContent.shiftEnd(Unknown Source)
 at javax.swing.text.GapVector.open(Unknown Source)
 at javax.swing.text.GapVector.replace(Unknown Source)
 at javax.swing.text.GapContent.insertString(Unknown Source)
 at javax.swing.text.AbstractDocument.handleInsertString(Unknown Source)
 at javax.swing.text.AbstractDocument.insertString(Unknown Source)
 at org.jivesoftware.openfire.launcher.Launcher$5.construct(Launcher.java:437)
 at org.jivesoftware.openfire.launcher.SwingWorker$2.run(SwingWorker.java:134)
 at java.lang.Thread.run(Unknown Source)

我配置内存的方式:

D:\Openfire\bin目录下增加一个openfired.vmoptions文件,用来配置 JVM参数:

-Xms1024m
-Xmx1256m
-XX:SurvivorRatio=7
-XX:PermSize=256m
-XX:MaxPermSize=256m

 

指定了最大内存1256M,其中永久内存256M ,在控制台中看到openfire可用内存确实变大了,但是仍然解决不了大约每天内存溢出一次,哪位高人指点一下迷津?

 

0 0