解决java.lang.OutOfMemoryError: unable to create new native thread问题
来源:互联网 发布:淘宝转化率25%算正常吗 编辑:程序博客网 时间:2024/05/22 16:48
问题:
Java程序运行过程中抛出java.lang.OutOfMemoryError: unable to create new native thread,如下所示:
java.lang.OutOfMemoryError: unable to create new native threadat 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.processWorkerExit(ThreadPoolExecutor.java:1017)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1163)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
解决:
1.升级JVM到最新的版本
最新版本的JVM一般在内存优化方面做的更好,升级JVM到最新的版本可能会缓解测问题
2.从操作系统层面去解决
使用64位操作系统
如果使用32位操作系统遇到unable to create new native thread,建议使用64位操作系统
3.增大OS对线程的限制
如果使用Red Hat Enterprise Linux 6,编辑/etc/security/limits.d/90-nproc.conf,添加如下配置:
# /etc/security/limits.d/90-nproc.conf * soft nproc 1024 root soft nproc unlimited user - nproc 2048
0 0
- 解决 - java.lang.OutOfMemoryError: unable to create new native thread
- 解决 - java.lang.OutOfMemoryError: unable to create new native thread
- 解决 - java.lang.OutOfMemoryError: unable to create new native thread
- 解决 - java.lang.OutOfMemoryError: unable to create new native thread
- 解决 - java.lang.OutOfMemoryError: unable to create new native thread
- 解决 - java.lang.OutOfMemoryError: unable to create new native thread
- 解决 - java.lang.OutOfMemoryError: unable to create new native thread
- 解决 - java.lang.OutOfMemoryError: unable to create new native thread
- 解决 - java.lang.OutOfMemoryError: unable to create new native thread
- 解决 - java.lang.OutOfMemoryError: unable to create new native thread
- 解决 - java.lang.OutOfMemoryError: unable to create new native thread
- 解决 - java.lang.OutOfMemoryError: unable to create new native thread
- 解决 - java.lang.OutOfMemoryError: unable to create new native thread
- 解决 - java.lang.OutOfMemoryError: unable to create new native thread
- 解决 - java.lang.OutOfMemoryError: unable to create new native thread
- 解决 - java.lang.OutOfMemoryError: unable to create new native thread
- 解决 - java.lang.OutOfMemoryError: unable to create new native thread
- 解决 - java.lang.OutOfMemoryError: unable to create new native thread
- Android 5.X 新特性详解(四)——Material Design 动画效果
- Hibernate 中setResultTransformer的作用
- 【设计模式】单例模式
- 实习杂记(22):仿照VideoView+MediaPlayerController做视频
- Android中webview js与native方法互相调用
- 解决java.lang.OutOfMemoryError: unable to create new native thread问题
- 【代码安全】浅谈安卓开发代码混淆技术
- 哭吧!喜欢玩数独游戏的亲们!你被取代了——C语言解数独
- zabbix中文乱码解决方法
- Eclipse和MyEclipse的区别
- php下的命令行执行
- LATEX--排版神器
- XML、JSON及其解析
- node.js事件循环