Profiling Java Code from the Command Line

Related Topics

To profile Java applets, class files, JAR files, or code launched by container programs, from the command line, type:

For an applet

quantify [<Quantify options>] /java [/jit] <applet viewer> [<applet viewer options>] <applet>

For a class file

quantify [<Quantify options>] /java [/jit] <Java viewer> [<Java viewer options>] <class>

For a JAR file

quantify [<Quantify options>] /java <Java viewer> [<Java viewer options>] <JAR switch> <JAR file>.jar <class>

For a container program

quantify [<Quantify options>] /java [/jit] <exename> [<arguments to exename>]

 

Where

Represents

[<Quantify options>]

Options you can specify after the quantify command. For a list of options, click images\shortcut.gif

/java

Required for Java programs.

<applet viewer>

Your applet viewer. For example:

§    appletviewer.exe (with the full path) if you are using the Sun JVM

[<applet viewer options>]

Options that you normally use with your applet viewer.

<applet>

An HTML file (local applet) or a URL (Web applet).

<Java viewer>

Your Java viewer. For example:

§    java.exe if you are using the Sun JVM

<Java viewer options>

Options that you normally use with your Java viewer.

<class>

A class name.

<JAR switch>

The switch that your Java viewer requires for running a JAR file. For example:

§    -jar for the Sun viewer.

<JAR file>.jar

The name of your JAR file including the extension.

<exename>

Any container program.

[<arguments to exename>]

Arguments to pass to the container program.

For example, to profile a local applet and save the performance data in conjunction with the Sun JVM, you can type:

quantify /SaveData=index.qfy /java appletviewer file:///"C:\Program Files\MyJavaProjects\index.html"

Quantify launches the applet Index.htm, and saves the collected performance data to the Quantify data file (.qfy) Index.qfy without displaying any data analysis windows.

To profile a Web applet in Microsoft Internet Explorer, you can type:

quantify /java <path to IE>\iexplore -new http://www.mydomain.com/javadev/myjavaprojects/index.html

Quantify runs Internet Explorer with the specified argument -new, then launches the applet Index.htm and displays the Run Summary window as it collects performance data for the applet.

Notes:

§      For information about configuring your Java Runtime Environment for PurifyPlus, click images\shortcut.gif.

§      Quantify requires debug data to profile methods at the line level. For instructions for compiling Java code with debug data, refer to the documentation for your JVM.

§      To run programs from the command line, you must have the Rational/common directory in your PATH environment variable.

§      When profiling Java applets launched by Internet Explorer 4.0 with the Active Desktop installed, you must pass the -new argument to Internet Explorer. Otherwise, performance data is not collected for your applet. To check whether the Active Desktop is installed, right-click your desktop and choose Properties from the shortcut menu. If the Active Desktop component is installed, the Properties dialog box has a Web tab.

(C) Copyright IBM Corporation 1993, 2009.