Application Launch Different launch modes are defined in the Options tab of the Launch dialog.
Local Launch Local Launch means that the JProfiler should start a local VM with the main file of the target application. In this case the profiler front-end acts as a server and the target application connects to it as a client. The server and the client are started simultaneously and that is why you may set the options for the profiler and the command-line arguments passed to the target VM in one and the same dialog - Options tab of the Launch dialog. Profiling results and target application functionality are also available on one and the same host. This is the most frequently used Launch mode and is set as default.
Remote Attach The Remote attach launch mode stipulates that when the Launch command is invoked, the target application should be started in attach profile mode. This means that later another, remote JProfiler, can be attached to it, started by the Attach command. The application will not run until a connection with the remote profiler is established. The profiling command-line options from the Command used for profiling field are passed to the application interpreter along with information about the port on which the profiler will later attach. There are two ways to start an application in Remote attach mode:
By starting the application using the Remote attach mode for launching an application in JProfiler. In the Options tab of the Launch dialog choose Remote attach radio button. You may modify the port for this VM on which it waits for a connection from a profiler started in Attach mode. Then launch the application. By adding a Java command-line options when you start your application. They are the same as in the Command used for profiling field in the Options tab of the Launch dialog box along with an option specifying the connection port at the end, which has the following syntax: attach=5115. See Command Line Arguments for detailed description of all possible arguments supplied in the command line. For example:
java -Djava.compiler=NONE -Xrunprof:attach=5115 -classpath %CLASSPATH%;.\ demo.prosyst.profiler.RunMe
Note: It is important in this case that your system path points to the location of the prof.dll or libprofl.so file. Also an option is the working directory, the one where you have started the application from, to contain this file.
Remote Listen The Remote listen launch mode starts the application in listen mode. This means that there must already be a running remote JProfiler in Listen mode and the application attaches to it. The host on which this profiler is and the port on which it listens must be known and you must pass them to the interpreter as command-line options.
Note: The launch will fail if a profiler running in Listen mode is not found on the given host and port.
You can launch an application in Remote listen mode also, like in Attach mode, in two ways:
By using JProfiler. Choose the Remote listen from radio button from the Options tab of the Launch dialog and use the Launch command. The command-line options by default are set properly and you need to modify them only if you have some particular requirements. If you have modified them in a way that does not satisfy you, the Reset button reverts to the default ones. Set only the host where the profiler is running and the port. Enter them correspondingly - the host in the text field next to the Profiling host label from option and the port - in the Profiling port text field. Here, also the command-line options are passed to the application, with added info about the host and port which looks like: net=localhost:5115. When you launch the application the profiler started in Listen mode is monitoring the application you have just started and is receiving results. By adding a command-line options to the Java interpreter. They must be the same as listed in the Command used for profiling field of Options tab of the Launch dialog, but you have to add the option net=localhost:5115 at the end. It specifies the host and port, which are else determined by the Remote listen from and Profiler port fields. See Command Line Arguments section of the Getting Started document for detailed description of all possible arguments supplied in the command line. For example:
Java -Djava.compiler=NONE -Xrunprof:net=localhost:5115 -classpath %CLASSPATH%;.\ demo.prosyst.profiler.RunMe Note: It is important in this case that your system path points to the location of the prof.dll or libprofl.so file. Also an option is the working directory, the one where you have started the application from, to contain this file.
