The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →A Java application that appears to restart every six seconds may be exiting and being relaunched by a supervisor—or it may still be running but stuck. Those are different failures, and the interval alone does not identify the cause. First establish whether the process exits, remains alive, or stalls during shutdown; then use logs, thread evidence, and, when appropriate, the deployed bytecode to narrow down the cause.
First determine what “restarting” means
The six-second interval, runtime version, operating system, exit code, and root cause are not established for this case. Treat the timing as an observation to verify, not proof of a JVM bug or a typical restart interval.
Record timestamps and process IDs across several cycles. Capture the Java vendor and version, exit codes, standard output and error, and service-manager or container events. This separates three states that can look similar in a dashboard:
- The process exits and a new PID appears: investigate why the JVM terminates and what supervisor or restart policy launches it again.
- The same process remains alive but makes no progress: investigate a hang, deadlock, or other stalled work.
- The process is still shutting down: inspect shutdown hooks and threads that may be preventing shutdown from completing.
A supervisor’s restart policy can create a regular interval independently of the application’s own logic. Only timestamps, PIDs, exit status, and supervisor events can show whether the six-second rhythm belongs to the program or its environment.
If the JVM is still alive, distinguish a loop from a hang
Compare CPU use with visible progress. Oracle recommends treating high CPU use as a clue to investigate a loop and low or idle CPU use as a clue to investigate a hang, such as a deadlock; neither observation alone proves the diagnosis. Capture more than one thread dump if the behavior persists, so you can see whether threads are progressing or repeatedly blocked at the same points.
For a live JVM, the JDK 26 documentation describes jcmd <pid> Thread.print for printing thread stack traces and documents Java Flight Recorder as a troubleshooting resource. Confirm which commands the target JVM supports, and record its exact build and platform; tooling can vary with the runtime in use. See Oracle’s JDK 26 jcmd manual and Java Flight Recorder troubleshooting guidance.
Rank #2
If the process exits, find out what initiated shutdown
The Java Runtime can begin shutdown when its last non-daemon thread exits, when code invokes Runtime.exit or System.exit, or after an external event such as an operating-system signal. Each possibility points to different evidence: thread lifetime and application logs for an ordinary exit, call paths for explicit exit, and system or supervisor records for an external signal. Oracle’s Java SE 26 Runtime API describes these shutdown mechanisms.
Shutdown hooks run concurrently, and shutdown completes only after the hooks terminate. A hook that never finishes can leave shutdown in progress rather than producing a clean exit. Oracle cautions that hooks should be defensive, avoid deadlocks, and finish quickly; calling exit from a shutdown hook can also prevent shutdown completion. The API notes: “It is possible that one or more shutdown hooks do not terminate, for example, because of an infinite loop.”
Free tools Windows power users keep installed
One-click scans. No signup required.
When bytecode inspection can help
Bytecode inspection is useful when logs or thread stacks point to a particular class and method, or when deployed behavior does not match the source you expect. Inspect the class file from the actual deployed JAR or directory—not just the checked-in source, which may not match the running artifact.
- Identify the target artifact. Locate the class implicated by the runtime evidence. Preserve the original class or JAR and record its hash so the analyzed file is identifiable.
- Disassemble it with the JDK. A practical starting point is
javap -c -p path/to/Example.class. Check the JDK 26 javap manual for the target JDK’s supported options. - Trace relevant control flow. Examine instructions and branch targets, constants, exception tables, and line-number metadata when present. Look for repeated branches, exit calls, or code paths that align with the runtime evidence.
- Compare carefully. A third-party decompiler may make control flow easier to read, but its output is a reconstruction, not proof of the original source. Check the underlying bytecode when a detail matters.
The JVM specification describes method bytecode in the class-file Code attribute; see the Java Virtual Machine Specification, Chapter 4. Disassembly can show what instructions and control flow are present in that artifact. By itself, it cannot establish the process’s runtime state, prove what the original source looked like, or explain why an external supervisor restarted the process.
Rank #4
Match the evidence to the next investigation
| Observed evidence | Investigate next |
|---|---|
| A new PID follows each exit | Exit code, application logs, explicit exit paths, non-daemon thread lifetime, operating-system signals, and supervisor events. |
| The PID stays the same and CPU use is high | Repeated thread dumps and, where supported, Flight Recorder data; use stacks to identify a likely hot loop before inspecting the implicated deployed class. |
| The PID stays the same and CPU use is low | Thread states and repeated dumps for blocked or deadlocked work. |
| Shutdown begins but does not finish | Shutdown hooks, their logs and thread states, and any hook that blocks, deadlocks, loops, or invokes exit. |
No available evidence establishes that a particular decompiler was used in the titled story or that decompilation exposed its cause. The method is valuable as one step in an evidence-led investigation—not as a substitute for proving what the running process and its supervisor are doing.
Quick Recap
Best Value
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




