Step 2 - Deploy agent
ProfilerJ utilizes the java.lang.instrument package to instrument the byte code of the application to be profiled. All the instrumentation stuff along with a transfer-handler allowing remote access via sockets is in com.terrasoft.jrc.agent.jar. To deploy the agent, modify example01.bat so that it looks like:
set profiler=-Xbootclasspath/a:com.terrasoft.jrc.agent.jar -javaagent:com.terrasoft.jrc.agent.jar=suspend=y,waitonexit=y
Start example01.bat now and you will see something like this:
profilerJ Agent V1.4.0-b7, Copyright (c) 2006 Terrasoft Software GmbH. All rights reserved.
The switch "...suspend=y,..." causes the agent to suspend execution until it receives a "resume" command. Shortly speaking, we need a ProfilerJ-Client (which connects to localhost:9000 ) in order to send a "resume". Currently we provide two clients: