Profiling Java Code from the Command Line (Memory Profiling)

Related Topics

To profile Java code from the command line, type:

For a Java applet

Purify [<Purify options>] /java <applet viewer> [<applet viewer options>] <applet>

For a Java class file

Purify [<Purify options>] /java <Java viewer> [<Java viewer options>] <class>

For a Java JAR file

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

For Java code launched from a container program

Purify [<Purify options>] /java <exename> [<arguments to exename>]

 

Where

Represents

Purify [<Purify options>]

The purify command followed by any options you want to use, such as /SaveData. For a list of options, click images\shortcut.gif

 

/java

Required to run Java code.

<applet viewer>

Your applet viewer. For example:

§          appletviewer.exe if you are using the Sun JVM

 

<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 Java 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 Java applet using the Sun JVM and save the memory profiling data, you can type:

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

Purify launches the applet index.htm, and saves the collected memory profile data to the Purify memory profiling data file (.pmy) index.pmy, without opening the memory profiling user interface.

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

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

Notes:

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

§      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, memory 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 1992, 2010.