ProfilerJ in a nutshell
Content of distribution
The distribution of profilerJ (i.e. profilerJ...zip,profilerJ...gz or profilerJ-1.4.0.msi ) consists of the following files:
Start profilerJ-1.4.1.msi and follow instructions.
Expand the archive profilerJ-1.4.1.zip (.gz, .tar respectively) to a directory of your choice (e.g.
Add the following statements to the startup-script of the java application you want to profile:
Alternatively, you can store your command-line arguments into a property file. This is extremely useful, when the command-line gets bloated:
java -Xbootclasspath/a:"...\com.terrasoft.jrc.agent.jar" -javaagent:"... \com.terrasoft.jrc.agent.jar=properties=profilerj.cfg" -cp foo.jar com.terrasoft.foo
where profilerj.cfg is a file containing command line arguments. To automatically write code coverage metrics when the application exits, the file profilerj.cfg would contain something like shown below:
Take a look at agent.suspend. You probably have noticed, that this option - when defined in the command line - doesn't have the prefix "agent.". To keep the command line small, ProfilerJ adds a "agent." to every option which doesn't contain a dot (".").
To activate JMX support, you will have to add -Dcom.sun.management.jmxremote to the command line.
How to create snapshots
Run profilerjCMD.cmd or (profilerjCMD.sh respectively). To gather profiling information by sampling, switch on the sampler:
> sampler on
To resume a suspended application, type "resume" (or any valid abbreviation i.e. re[sume]):
Create a snapshot by typing sna[pshot]:
See tutorial to find out how to use ProfilerJ-viewer.