Jinsight Reference Manual
Tracing Tips
The key to using Jinsight effectively lies in making good traces.
A "good" trace not only records the information you're ultimately interested
in; it is also of reasonable size. It's all too easy to create unworkably
large traces, especially if you're not studying anything in particular.
Tracing every detail of a program's execution will generate trace information
rapidly, the resulting traces quickly running into the hundreds of megabytes
and more.
Here are some statistics that should give you a feel for the resources
involved. The numbers were obtained on a 200 MHz Pentium Pro machine
with 96 MB of RAM, running Jinsight with a just-in-time Java compiler.
- Traces grow at a rate of 15-30 MB/minute, depending on the level of tracing
detail.
- Jinsight itself can visualize traces of up to a few tens of megabytes (over
1 million events) with no problem using the -mx VM flag in conjunction
with the JINSIGHT_MAXHEAP variable.
- Jinsight reads traces at a rate of about 12 MB/minute.
These figures make it imperative that you focus your trace collection efforts.
The last thing you want to do is execute a long-running program from start to
finish with full tracing. As a rule of thumb, you should limit your traces
to the most interesting 1-5 minutes (cumulative) of execution. This will create
about 50 MB trace files taking about 4 minutes for Jinsight to read..
Here are some specific things you can do to improve performance:
-
Don't trace aimlessly. Have a goal: tracking down a bug, tuning performance,
or understanding certain behavior.
-
Take several small traces instead of one big one.
-
Use partial tracing to focus
on important parts of the execution, thereby reducing the size of each
trace. You can capture just constructor calls and omit all other methods.
You can also turn tracing off entirely, either by hand or under program
control, during uninteresting parts of the execution.
-
If you are focusing on memory leaks, you can omit all execution tracing
and just take snapshots of object population and reference information
at important points in your program, considerably reducing the size of
the trace.
-
Filtering lets Jinsight read bigger
traces. For example, filtering out java/ and sun/
events typically doubles the size of traces you can view.
See the Jinsight How-To Guide for more
tips on tracing for specific tasks.