Profiler
A simple CPU profiling tool similar to java -Xrunhprof. It can be used
in-process (to profile the current application) or as a standalone program
(to profile a different process, or files containing full thread dumps).
| Methods |
| static Instrumentation |
getInstrumentation()
Get the instrumentation object if started as an agent.
|
| static Instrumentation |
getInstrumentation()
Get the instrumentation object if started as an agent.
Returns:
the instrumentation, or null
|
| static void |
main(String... args)
Run the command line version of the profiler.
|
| static void |
main(String... args)
Run the command line version of the profiler. The JDK (jps and jstack)
need to be in the path.
Parameters:
args - the process id of the process - if not set the java processes
are listed
|
| static void |
premain(String agentArgs, Instrumentation inst)
This method is called when the agent is installed.
|
| static void |
premain(String agentArgs, Instrumentation inst)
This method is called when the agent is installed.
Parameters:
agentArgs - the agent arguments
inst - the instrumentation object
|
| String |
getTop(int count)
Get the top stack traces.
|
| String |
getTop(int count)
Get the top stack traces.
Parameters:
count - the maximum number of stack traces
Returns:
the stack traces.
|
| void |
run()
|
| void |
run()
|
| Profiler |
startCollecting()
Start collecting profiling data.
|
| Profiler |
startCollecting()
Start collecting profiling data.
Returns:
this
|
| Profiler |
stopCollecting()
Stop collecting.
|
| Profiler |
stopCollecting()
Stop collecting.
Returns:
this
|