bootstrap = new ServerBootstrap(new NioServerSocketChannelFactory(
Executors.newCachedThreadPool(),
Executors.newCachedThreadPool()));
异常
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:949)
at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1360)
at org.jboss.netty.handler.execution.MemoryAwareThreadPoolExecutor.doUnorderedExecute(MemoryAwareThreadPoolExecutor.java:455)
at org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor$ChildExecutor.execute(OrderedMemoryAwareThreadPoolExecutor.java:292)
at org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor.doExecute(OrderedMemoryAwareThreadPoolExecutor.java:242)
at org.jboss.netty.handler.execution.MemoryAwareThreadPoolExecutor.execute(MemoryAwareThreadPoolExecutor.java:440)
at org.jboss.netty.handler.execution.ExecutionHandler.handleUpstream(ExecutionHandler.java:172)
at org.jboss.netty.handler.codec.frame.FrameDecoder.exceptionCaught(FrameDecoder.java:378)
at org.jboss.netty.channel.Channels.fireExceptionCaught(Channels.java:533)
at org.jboss.netty.channel.AbstractChannelSink.exceptionCaught(AbstractChannelSink.java:48)
at org.jboss.netty.channel.Channels.fireChannelBound(Channels.java:199)
at org.jboss.netty.channel.socket.nio.NioWorker$RegisterTask.run(NioWorker.java:185)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.processRegisterTaskQueue(AbstractNioWorker.java:430)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:329)
at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:35)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
通过JvisualVm监控,发现线程数达到1000的时候出现异常,于是怀疑是linux系统做了限制。
ulimit -a
max user processes (-u) 1024
修改成65535后,继续测试,问题解决。表面上是内存溢出,实际上是linux系统限制
分享到:
相关推荐
java.lang.OutOfMemoryError: Java heap space 解决方法
java.lang.OutOfMemoryError: PermGen space 解决方案
搜集整理关于java错误处理:java.lang.OutOfMemoryError: Java heap space java.lang.OutOfMemoryError: Java heap space 资料整理
Caused by: java.lang.OutOfMemoryError: PermGen space解决方案, avax.servlet.ServletException: java.lang.OutOfMemoryError: PermGen space at org.apache.jasper.servlet.JspServlet.service(JspServlet.java...
报错 java.lang.OutOfMemoryError: PermGen space 报错 java.lang.OutOfMemoryError: Java heap 启动报错java.lang.ClassNotFoundException: 1catalina.org.apache.juli.FileHandler JAVA_OPTS="-server -Xms800m ...
内存不足OOM java.lang.OutOfMemoryError.
java.lang.OutOfMemoryError: PermGen space及其解决方法,解决项目太大tomcat内存溢出
NULL 博文链接:https://geyubin.iteye.com/blog/779330
记录java.lang.OutOfMemoryError:Java heap space的情况 文章内容: 一.问题描述+原因分析+解决方案 二.JVM调优说明 三.Tomcat添加到jvisualvm监控
java解决nested exception is java.lang.OutOfMemoryError Java heap space 解决OOM
问题分析:java.lang.OutOfMemoryError unable to create new native thread - ado1986 - CSDN1
Tomcat给我的java.lang.OutOfMemoryError: PermGenTomcat给我的java.lang.OutOfMemoryError: PermGenTomcat给我的java.lang.OutOfMemoryError: PermGenTomcat给我的java.lang.OutOfMemoryError: PermGenTomcat给我的...
Myeclipse下java.lang.OutOfMemoryError Java heap space的解决
Tomcat内存溢出的解决方法(java.util.concurrent.ExecutionException:java.lang.OutOfMemoryError),内附解决方案!
java.lang.OutOfMemoryError处理错误
java.lang.OutOfMemoryError: PermGen space
java.lang.OutOfMemoryError: Java heap space 解决方法
tomcat内存溢出解决办法,错误信息:java.lang.OutOfMemoryError:PermGen space 参考该文档可快速解决内存溢出的问题,服务器:tomcat
编译时出现java.lang.OutOfMemoryError Java heap space异常.