code: public void run() {
      /* check if running the routine is still necessary */
      if(shutDownHookExecuted) {
        return;
      }
      synchronized (processes) {
        running = true;
        Enumeration e = processes.elements();
        while (e.hasMoreElements()) {
          destroy((Process) e.nextElement());
        }
        processes.clear();
        shutDownHookExecuted = true;
      }
    }
docs: Invoked by the VM when it is exiting.