Java Reference
In-Depth Information
Selecting new locals in scope
If the
Select new locals in scope
option is selected in the
Customize View
win-
dow, the
Frame
view automatically selects and highlights local variables as
they're first encountered while stepping through your code. If you're sorting
alphabetically, enabling this option will quickly alert you to the introduction of
new variables.
Enabling the alternate view for collections
The debugger provides two different ways of viewing collection objects (such as
List
s or
Set
s) in the
Frame
view. By default, the debugger displays a collection
class as it does any other. If you drill down into the class in the
Frame
view, you
can navigate its field and internal references. However, another view is available
that, although more convenient, comes at the cost of performance.
The alternative view treats collections more like arrays, showing you the size of
the collection and allowing you to easily see and examine its contents, much as
you would an array variable. The
Alternate view for Collections classes
option
in the
Customize View
window is used to switch between the two views.
6.5.4
Improving the speed of the debugger
Although the debugger is certainly useable, you must expect that your applica-
tions will inherently run somewhat slower in the debugger than in a production
mode. In
JDK
1.3, there were also noticeable speed differences in the debugging
VM
, but these have largely disappeared as of
JDK
1.4.1. The speed decrease is pri-
marily due to the extra overhead required by
IDEA
to process and evaluate the
debugging information coming back and display it in the debugger. Here are a
number of ways you can speed things up, should debugging prove too slow in
your situation:
Turn off the alternate collections view
. The alternate collections view (which
views collections as pseudoarrays) requires additional overhead, because it
forces the debugger to evaluate the contents of any collection it encoun-
ters. This can be a problem particularly if you have a large number, or any
number of very large collections.
■
Turn off the 'view as
String
' mode
. Likewise, forcing the debugger to call the
toString()
method for all your objects introduces extra work for the sys-
tem. Try turning off this option or at least limiting the number of classes
you use it option.
■