When JVM crashes, Heap dump file(hs_err_pidXXXX.log) is created in the working directory. I want to know who creates this file. JVM crashed means it has terminated abnormally. So it will definitely not create this file. So how is this file created?
Also can we control the information displayed in this file. If I want to have thread dump and heap dump both together in a single file (hs_err_pidXXXX.log) is it possible? If yes how? Basically my priority is to identify the function(or stacktrace) that caused JVM to crash and store it on the Heap dump file that is created.
Many operating systems allow a process to register a handler for certain exceptional conditions. For example in UNIX there is the concept of signals.
So it is possible that the JVM itself writes the log.