当前位置: 首页 > 知识库问答 >
问题:

jWebSocket java.lang.OutofMemoryError:无法创建新的本机线程

袁山
2023-03-14

我试图在CentOS 5.8(1and1VPS)上运行JWebSocket服务器。就在服务器启动和客户机的几个请求(重新加载网页)之后,我得到了这个错误:

Exception in thread "jWebSocket TCP-Connector 01.33719.16" java.lang.OutOfMemoryError: unable to create new native thread
        at java.lang.Thread.start0(Native Method)
        at java.lang.Thread.start(Thread.java:691)
        at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:943)
        at java.util.concurrent.ThreadPoolExecutor.ensurePrestart(ThreadPoolExecutor.java:1555)
        at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(ScheduledThreadPoolExecutor.java:333)
        at java.util.concurrent.ScheduledThreadPoolExecutor.schedule(ScheduledThreadPoolExecutor.java:546)
        at java.util.concurrent.ScheduledThreadPoolExecutor.submit(ScheduledThreadPoolExecutor.java:646)
        at org.jwebsocket.tcp.TimeoutOutputStreamNIOWriter.sendPacket(TimeoutOutputStreamNIOWriter.java:215)
        at org.jwebsocket.tcp.TCPConnector.sendPacket(TCPConnector.java:279)
        at org.jwebsocket.server.BaseServer.sendPacket(BaseServer.java:186)
        at org.jwebsocket.server.TokenServer.sendPacketData(TokenServer.java:405)
        at org.jwebsocket.server.TokenServer.sendTokenData(TokenServer.java:388)
        at org.jwebsocket.server.TokenServer.sendToken(TokenServer.java:312)
        at org.jwebsocket.plugins.TokenPlugIn.sendToken(TokenPlugIn.java:174)
        at org.jwebsocket.plugins.system.SystemPlugIn.sendWelcome(SystemPlugIn.java:397)
        at org.jwebsocket.plugins.system.SystemPlugIn.connectorStarted(SystemPlugIn.java:261)
        at org.jwebsocket.plugins.BasePlugInChain.connectorStarted(BasePlugInChain.java:126)
        at org.jwebsocket.server.TokenServer.connectorStarted(TokenServer.java:170)
        at org.jwebsocket.engines.BaseEngine.connectorStarted(BaseEngine.java:93)
        at org.jwebsocket.tcp.TCPEngine.connectorStarted(TCPEngine.java:320)
        at org.jwebsocket.tcp.TCPConnector$ClientProcessor.run(TCPConnector.java:502)
        at java.lang.Thread.run(Thread.java:722)

但是当我在计算机上运行JWebSocket时,一切都正常。我使用VirtualBox和Centos5.8新安装制作了自己的虚拟服务器,它也在那里工作。

这个内存不足错误的原因可能是什么?如果你有任何建议,请分享。我不知道该怎么处理这个了。

共有1个答案

富凯旋
2023-03-14

查看链接:http://devgrok.blogspot.sk/2012/03/resollish-outofmemoryerror-nonable-to.html
听起来它们必须在linux中增加每个用户的最大进程限制。
至少与您的问题相似,我看到的是您得到了相同的异常+都运行linux:)

 类似资料: