My program throws the following exception:
java.lang.OutOfMemoryError: unable to create new native thread
But when I added -XX:+HeapDumpOnOutOfMemoryError
to the jvm parameters, but it seems that jvm didn't dump the heap, cause I never find any .hprof file. Why?
See the section marked "Evaluation" at the bottom of this bug report.
http://bugs.sun.com/view_bug.do?bug_id=6784422
The -XX:+HeapDumpOnOutOfMemoryError
will not trigger the dump when you cannot create a new native thread.
Failure to create a thread isn't actually an out of memory condition; it's usually caused by a lack of native OS resources, not a lack of heap space. A heap dump is probably not what you want in this situation... a stack dump of your current threads is likely to be far more useful.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With