user3586651
user3586651

Reputation: 15

-XX:OnOutOfMemoryError doesn't work for java.lang.OutOfMemoryError: unable to create new native thread

I use -XX:OnOutOfMemoryError=\"kill -9 %p\". It works for most of out of memory cases, but it doesn't kill the process for java.lang.OutOfMemoryError: unable to create new native thread.

Upvotes: 1

Views: 572

Answers (1)

kow
kow

Reputation: 71

It may well be that the system cannot handle any more threads. That, unfortunately, would also mean that no new processes can be created - but the kill command would run as a new process! A rather unpleasant Catch-22...

Upvotes: 2

Related Questions