In any linux/unix based application we will get into the situation where we unable to start the application. We will get the below exceptions.


Caused by: java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: unable to create native thread: possibly out of memory or process/resource limits reached
              at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:?]
              at java.util.concurrent.FutureTask.get(FutureTask.java:191) ~[?:?]

Reason:
Main cause for this issue is in Linux each user level maximum number of process is assigned by default. Some cases application threads exceeds more than default number configured for this user,Then we started seeing above error. This setting can be configured in user level/OS level.

How to check the number of threads assigned for each user in Linux. We can use below command

ulimit -a


unable-to-create-thread
If we have an administrative rights we can change this settings by editing below file

/etc/security/limits.d/20-nproc.conf