1

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.

1
  • Can you share any more details on the issue? What types of application you are running this in, exception details, etc? Commented Apr 29, 2014 at 19:24

1 Answer 1

2

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...

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.