profile applicationInstruments a program to keep track of how much elapsed time is spent in methods of the program. You control which methods are instrumented by the arguments you specify. For example, java yourpkg.mainclass -sc pkg -op tempdir instruments each method of each used class in yourpkg, and outputs the instrumented classfiles to tempdir. After the program has been instrumented, you can now do profiling runs:
The following data is output for each instrumented method that consumes at least 1% of the application's run time, and either invokes another method or contains a loop:
Restrictionsprofile can be used on a GUI program only if the program terminates in either of the following ways:
profile does not work on applets and servlets. (However it is possible to manually insert the desired start point and end point code in a program. See atEndOf() of profile.java in the JTrek kit's src directory). profile will not instrument contructors in the java. and sun. classes. |