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

拥有回忆 提交于 2021-02-19 09:24:32

问题


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:


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



来源:https://stackoverflow.com/questions/23373117/xxonoutofmemoryerror-doesnt-work-for-java-lang-outofmemoryerror-unable-to-cr

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!