![the user interface thread appears to be frozen pingplotter the user interface thread appears to be frozen pingplotter](https://venturebeat.com/wp-content/uploads/2018/05/screen-shot-2018-05-08-at-4-46-01-pm.jpg)
If the VM does not respond to a Ctrl-\ this could indicate a VM bug rather than an issue with application or library code. If a thread appears to be looping continuously while in the RUNNABLE state, this situation can indicate a potential HotSpot VM bug that needs further investigation. If a thread appears to be always in the RUNNABLE state, then the -m option can be used to print the native frames and can provide a further hint on what the thread is doing. It might be necessary to execute jstack a number of times to get a more complete picture of which threads are looping. This is the most likely state for threads that are busy and possibly looping. When reviewing the output of the jstack utility, focus initially on the threads that are in the RUNNABLE state. The jstack utility should also be used if the thread dump does not provide any evidence that a Java thread is looping. See 2.11 jstack Utility for information on the output of this utility. Use the jstack -F pid option to force a stack dump of the looping process. If the application console is not available (process is running as a background process, or the VM output is directed to an unknown location), then the jstack utility can be used to obtain the stack thread.
![the user interface thread appears to be frozen pingplotter the user interface thread appears to be frozen pingplotter](https://venturebeat.com/wp-content/uploads/2019/04/chrome-remove-animations.png)
In some cases it might be necessary to get a sequence of thread dumps in order to determine which threads appear to be continuously busy. See 2.15.1 Thread Dump for information on the format of the thread dump, as well as a table of the possible thread states in the thread dump. If a thread dump can be obtained, then a good place to start is the thread stacks of the threads that are in the runnable state. If the Java process is started with the -XX:+PrintClassHistogram command-line option, then the Ctrl-Break handler will produce a heap histogram. The output might be directed to a file, depending on how the process was started. In this case the thread dump is printed to the standard output of the target process. On Solaris OS and Linux the thread dump can also be obtained by sending a SIGQUIT to the process (command kill -QUIT ). If the application console (standard input/output) is available, then press the Ctrl-\ key combination (on Solaris OS or Linux) or the Ctrl-Break key combination (on Windows) to cause the HotSpot VM to print a thread dump, including thread state. If the looping thread can be identified, then the trace stack in the thread dump can provide direction on where (and maybe why) the thread is looping. If a thread dump can be obtained, it will often be clear which thread is looping. If a VM process appears to be looping, the first step is to try to get a thread dump. On Solaris OS, for example, the command prstat -L -p can be used to report the statistics for all LWPs in the target process and thus will identify the threads that are consuming a lot of CPU cycles. If the process appears to be busy and is consuming all available CPU cycles then it is likely that the issue is a looping thread rather than a deadlock. To do this requires using an operating system utility.
![the user interface thread appears to be frozen pingplotter the user interface thread appears to be frozen pingplotter](https://venturebeat.com/wp-content/uploads/2020/01/activecampaign-dashboard-screenshot.png)
For example, a bug in a VM process that causes one or more threads to go into an infinite loop can consume all available CPU cycles.Īn initial step when diagnosing a hang is to find out if the VM process is idle or consuming all available CPU cycles. Sometimes an apparent hang turns out to be, in fact, a loop. A hang can even be due to a bug in the HotSpot virtual machine. A hang can occur for many reasons but often stems from a deadlock in application code, API code, or library code. Problems can occur that involve hanging or looping processes. This chapter provides information and guidance on some specific procedures for troubleshooting hanging or looping processes. Environment Variables and System PropertiesĬhapter 5 Troubleshooting Hanging or Looping Processes Integrating Signal and Exception Handling Troubleshooting Hanging or Looping Processes