|Home||HProf Ant Task||DashProf Ant Task||Download|
-Xrunhprof. By default, hprof dumps profile data to the file java.hprof.txt; this can be changed using the
For more information on hprof, see the prophIt hprof page.
hprof Ant task makes it easy to profile any Java program using the standard Ant
javaAnt task in your Ant build file. Next, define the
taskdefin your build file according to the following example:
<taskdef name="hprof" classname="net.sf.antprof.HProf" classpath="/path/to/antprof.jar" />
hproftask around the
<target name="profile"> <hprof> <java classpathref="class.path" classname="your.Application" /> </hprof> </target>
ant.bat profileThis command gathers CPU profile information and dumps it to the file java.hprof.txt when the Java VM exits.
|destfile||Specify an alternate output file name, according to the following example:
<hprof destfile="app.hprof.txt"> <java classpathref="class.path" classname="your.Application" /> </hprof>
Note : No task attributes are required.
See this paper on profiling methods for a discussion of samplinig and timing methods.
Increasing the stack depth can improve the resolution of the profile, at the expense of increasing the size of the data file.
Each time the hprof CPU profile is activated (either periodically in 'samples' mode, or for each function entry and exit in 'times' mode), hprof examines the call stack of each thread. A counter is maintained for each unique call stack. When the profile data is dumped to the data file or network connection, each call stack is written along with its counter. This option specifies the depth of each call stack.
|hotspot||If you are using the JDK 1.2, AntProf automatically turns off the HotSpot interpreter. If you are having trouble with hprof in a newer version of Java, you can manually specify
|netAddress||Instructs hprof to send the profile data file out to a socket connection. Specified as <host>:<port>.
|dumpThread||Include the thread ID in the stack traces. If this option is not enabled, all matching stack traces are grouped together regardless of which thread they come from.||No|
|binary||Instruct hprof to use its binary format for the data file. This binary format is not documented so this option is not very useful.||No|
hproftask always sets the
javatask attribute fork="yes", because the hprof library is only loaded by the JVM when a new JVM is started
hprofusage information by invoking:
-Xrun<name>JVM option loads the library <name>.dll or <libname>.so and initializes it to use the JVMPI and JVMDI VM extension APIs.
-Xrunhprofuses this feature to load hprof.dll or libhprof.so.