How to do thread dump on Out Of Memory Error [duplicate]
This question already has answers here : how to generate thread dump java on out of memory error (6 answers) Closed 6 years ago . I know that -XX:+HeapDumpOnOutOfMemoryError will enable heap dump on OutOfMemoryError. Is there anything similar for thread dump? I need this in case when error happens on server - I don't have access to process itself when it happens zagyi The exact point of execution where an OutOfMemoryError is raised is very much random (unless you have a single threaded application), so I don't think it would make too much sense to get a thread dump upon OOM. At least this is