ElasticSearch throwing “OutOfMemoryError[unable to create new native thread]” error

Your heap is OK. The exception means that your OS can not create new native threads. The number of threads in a JVM is limited by the OS process stack, not the JVM heap, so the exception message might be a bit misleading.

Anyway, it takes many many thousands of threads to create such an exception. This vast number is not manageable by a JVM or an operating system and will bring down a process to a halt.

So you should inspect your cluster configuration if you have thread pools configured that are unlimited. This is a very bad idea and therefore not configured by default. Unlimited thread pools are a classic method to bring a cluster down. Set up reasonable limits for thread pools.

1 Like