Pausing and Resuming the Debugger

You can pause your program when the program is running in the debugger. You can then use the debugger to examine the state of your program with respect to this program location. When you have finished examining that part of the program, you can then continue running the program.

When you are using the debugger, your program can be in one of two possible states: running, or paused by the debugger. When your program is waiting for user input, it is still considered to be running. When your program is in the running mode, Pause is available. When your program is paused by the debugger, the available debugger buttons include Resume, Step Over, Step Into.

You can pause the debugger in the following ways:

Your program may be paused at a location for which there is no source available. In this case, the Source Not Found dialog is displayed prompting you for the source file location or whether to generate stub files.

Also, your program may be paused at a location where tracing is disabled because the class is on the tracing exclude list. For example, your program may be paused in the java.lang.Object.wait method.

While the debugger is paused, you can force garbage collection to occur. The results of the garbage collection are immediately reflected in the Heap and Classes windows. By providing the Heap and Classes windows and enabling garbage collection, the debugger is a powerful tool for finding memory leaks in your application.

To resume the debugger when it is paused, choose Debug then choose Resume.


Related topics

Running a Program in the Debugger
Controlling Which Classes are Traced Into
Moving Through Code While Debugging
Using the Source Editor When Debugging