OOMError【真实案例】_ unable to create new native thread原因及解决办法

文章目录

背景

项目上线后,发现每隔一段时间,就会出现如下异常:

Caused by: java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Thread.java:714)
at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:950)
at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1357)
at java.util.concurrent.CompletableFuture.asyncRunStage(CompletableFuture.java:1640)
at java.util.concurrent.CompletableFuture.runAsync(CompletableFuture.java:1858)

排查

可能原因是两种情况:

  • JVM内存太小无法继续创建线程:配置的-Xmx -Xms都是10g,没理由不够的
  • 达到操作系统限制,所以无法创建线程:root账号启

猜你喜欢

转载自blog.csdn.net/u012383839/article/details/130791997
今日推荐