
|
|
Download one of the Jinsight2.1 packages from IBM alphaWorks. Make sure the environment variables in the command file jinsight reflect your installation. In particular, check variables JINSIGHT_HOME and JAVA2_HOME. Then go to directory jinsight2.1, and invoke the command file: jinsight
This should bring up the Jinsight workspace window, where you choose File and Open Trace File, and then select the trace you want to visualize. For a sample trace, open the directory traces, pick the Hang.trc file, and click on Open. Then push the Load button on the workspace window.
Details:
The documentation is in HTML files in all of the download packages.
It is in the directory jinsight2.1\docs.
The documentation provides an executive summary, a quick start with installation details,
a guided tour, a how-to guide, a reference manual,
FAQs, and release notes.
Look at the Jinsight Release Notes.
Additional details about recent visualizer features can be found in the
guided tour, for example, under
Table View, Call Tree View, and Navigation, and
Slices and Workspaces.
Further details are in the reference manual, for example, under
Call Tree View,
Table View, and
Slices and Workspaces.
In the command file jinsight_trace, use the -Xmx Java option to set the maximum Java heap size, and use the JINSIGHT_MAXHEAP variable to continue (by not loading detailed trace information) when nearing the memory limit. For extremely large traces, you can also set trace filtering in the visualizer, which can filter out trace events by package name or by stack depth during trace loading.
Details:
java.exe -Xmx230M -DJINSIGHT_MAXHEAP=230M jinsight.main.Jinsight sample.trc
Use the command file jinsight_trace, to invoke your program and use Jinsight. For Jinsight2.1 (for Java 2), the instrumentation is a profiling agent using the JVMPI interface of Java 2. For Jinsight2.0 (for Java 1.1.8), the instrumentation is a replacement tracing VM that is installed in either directory n118p-2.0 (on Windows), or directory a118-2.0 (on AIX).
Details:
for Jinsight2.1: set JINSIGHT_TRACE_METHODS=YES;
then enter: jinsight_trace loopTest
This will write a large trace file trace.trc.
Note that setting env var JINSIGHT_TRACE_METHODS to any value
will produce a very large trace
for anything but a very short running program.
for Jinsight2.0: enter: jinsight_trace -tracemethods loopTest
This will write a large trace file loopTest.trc.
Note that using option -tracemethods will produce a very large trace
for anything but a very short running program.
Read the section on creating traces. Control how much is traced by using one or more of the following:
Details:
-tracepopulation trace object creation/collection -tracemethods trace all method enters/leavesYou can begin without either option, and later issue a trace command at the console prompt.
tm start tracing methods tp start tracing population events sm stop tracing methods sp stop tracing population events S stop tracing g force synchronous garbage collection dp dump object population dr dump object population and references q end all tracing
(default) turn off tracing JINSIGHT_TRACE_METHODS turn on tracing methods JINSIGHT_TRACE_POPULATION turn on tracing object creation/collection
The Jinsight 2.0 calls are:
Runtime.getRuntime().traceMethodCalls(true); Runtime.getRuntime().traceMethodCalls(false); import com.ibm.jinsight.tracing.*; JinsightCtrl.dumpPopulation(); JinsightCtrl.dumpReferences();The Jinsight 2.1 calls are:
(you must explicitly use the import and the load statement before the calls)
import com.ibm.jinsight.tracing.*; // in file jintrace.jar, 06/19/2001 or later
System.loadLibrary("jinsightPA"); // required
int JinsightCtrl.startTracingMethods(); // tracing continues until you stop it
int JinsightCtrl.stopTracingMethods();
int JinsightCtrl.dumpPopulation();
int JinsightCtrl.dumpReferences();
int JinsightCtrl.forceGc();
int JinsightCtrl.quit(); // ends all tracing; closes trace file
Configuration and Tracing on AIX or Windows
Configuration and Tracing on OS/390
The remarks here pertain to Jinsight 2.0, with its instrumented JVM.
First try your program with the original uninstrumented JVM. Often renaming your DLLs may work if it is a load that is failing.
Details:
Fatal error: 0 Assertion failed: !exceptionOccurred(EE()), file ..\..\..\..\src\win32\sun\windows\awt_Frame.cpp, line 155 abnormal program termination
It could be you haven't specified the right class name.
Another possibility is that
your complete CLASSPATH string contains spaces. For example, it might have the string
'Program Files...' in it. If it does, jinsight_trace will treat the remainder
of your CLASSPATH string as the program name you are trying to trace, and will fail.
for Jinsight2.1: The default trace file name is trace.trc. You should ensure that you used the option -XrunjinsightPA on the Java 2 invocation (for example in the command file jinsight_trace, and that you employed one of the tracing controls (console command, env variable, API call) that would result in a trace being written.
for Jinsight2.0: The command file jinsight_trace should run the instrumented java_g.exe program (for Windows) or the instrumented java program (for AIX or OS/390), and should set the environment variable JINSIGHT to YES.
for Jinsight2.0, to turn tracing on, you can use one of several methods:
Runtime.getRuntime().traceMethodCalls(true)
Any of the above methods should produce a trace file
in the directory where jinsight_trace was run.
This probably means you are trying to read a newer trace format
but are using an older version of the Jinsight visualizer. For example,
the instrumented JVMs in Jinsight version 2.0 write traces with a header
that indicates trace format version 2.
The profiling agent in Jinsight version 2.1 writes a trace with a header
that indicates trace format version 4.
The solution is to use the latest
version of the visualizer (the Jinsight2.1 visualizer) to read traces.
This will likely be accompanied by the Workspace Window failing to show the total number of events. A properly completed trace normally records the total number of events. The Workspace Window uses this information to show progress as it loads the trace:
To ensure a complete trace, terminate your program as follows: type Ctrl-Break,
type q and press Enter.
No views are visible initially. You must open each view by choosing
it in the Workspace Window's Views menu (for example, choose Histogram=>Objects for
the Object Histogram view).
|
|