If I add a shutdown hook to my Java program\'s runtime like so:
public class MyShutdownHook implements Runnable { @Override public void run(
They only run if the process "shuts down normally." If the process is killed forcefully from the OS or if it's crashing due to resource issues (e.g., out of memory), shutdown hooks won't be invoked.