Profiling an application in stand-alone mode

The following information applies to Windows.

The following information applies to AIX.

The following information applies to Linux.

The following information applies to Solaris. You can profile an application in stand-alone mode (that is, from the command line), without having the Hyades tools installed. However, you do need to have the Agent Controller installed on the machine where the application to be profiled resides.

You can profile an application in stand-alone mode by invoking the Java Profiling Agent, which is a library that attaches to a Java virtual machine (JVM) to capture and record the behavior of your Java application. The output from the agent is in the form of XML fragments.

Use the -Xrun Java option to invoke the Java Profiling Agent:

    -XrunpiAgent:agent_parm[,agent_parm]*

For example, to profile PerformanceExample.java, using filters that are defined in the file myFilters.txt, and directing the data from the profiling session to a file called PEProfilingData, you would type the following on a command line:
    java -XrunpiAgent:server=standalone,filters=myFilters.txt,file=PEProfilingData.trcxml PerformanceExample

By augmenting the -XrunpiAgent parameter you can specify several different modes to run the profiling agent in. The parameter agent_parm can take one of the following values:

 

Format of class filter file

The format of the file is as follows:
   pattern mode

where:

pattern

A string with no imbedded blanks. The string may contain a single asterisk (*) either at the beginning of the string or at the end of the string. The * matches zero or more characters, thus making the pattern a generic prefix or suffix pattern. A sole * can also be specified to represent all strings.

mode

Specifies whether the class that matches the pattern is to be included or excluded from profiling. The value for mode is either INCLUDE or EXCLUDE.

Filter patterns are processed in the order that they are specified until the first pattern match succeeds. If the class name does not match any of the specified filter patterns, the default is to INCLUDE the class.

 

Java Profiling Agent Control

When the Java Profiling Agent is started with the server=enabled or server=controlled parameter, communication with the agent is done using the client workbench by means of the Agent Controller on the host machine.

 

Notes

Related concepts
Overview of the Profiling Tool
Profiling resources
Profiling monitor view

Related tasks
Profiling an application in standalone mode on AS/400
Launching or attaching a Java process