Starting Remote Sessions

     


  In most cases, the integration of JProfiler with an application server is handled by the application server integration wizards. If no GUI is available on the remote machine you can use the jpintegrate executable in the bin directory for a console integration wizard.
  If you want to quickly profile a JVM of version 1.6 or hight on a remote machine, extract a JProfiler archive from the download page on the remote machine. You do not have to enter a license key there. Run the bin/jpenable command line application on the remote machine. You will be able to select a JVM and load the profiling agent into it so that is listens on a specific profiling port.

In your local JProfiler GUI, create an "Attach to profiled JVM (local or remote)" session and enter the host name and the same profiling port that you specified in jpenable on the remote machine.

  To permanently start your application or application server in such a way that you can connect to it with a remote session from JProfiler's GUI front end, the following steps are required. They are different for the old profiling interface JVMPI and the new profiling interface JVMTI. For that latter, the required modifications are considerably simpler.
  • Java >= 1.5.0 (JVMTI)
    Add a VM parameter to your startup command that tells the VM to load the profiling agent:
        -agentpath:{Path to jprofilerti library}
              
    where {Path to jprofilerti library} depends on the operating system and the architecture of the JVM (not the architecture of the operating system):

    Windows, 32-bit {JProfiler install directory}\bin\windows\jprofilerti.dll
    Windows, 64-bit {JProfiler install directory}\bin\windows-x64\jprofilerti.dll
    Linux x86, 32-bit {JProfiler install directory}/bin/linux-x86/libjprofilerti.so
    Linux x86, 64-bit {JProfiler install directory}/bin/linux-x64/libjprofilerti.so
    Linux PPC, 32-bit {JProfiler install directory}/bin/linux-ppc/libjprofilerti.so
    Linux PPC64, 64-bit {JProfiler install directory}/bin/linux-ppc64/libjprofilerti.so
    Solaris SPARC, 32-bit {JProfiler install directory}/bin/solaris-sparc/libjprofilerti.so
    Solaris SPARC, 64-bit {JProfiler install directory}/bin/solaris-sparcv9/libjprofilerti.so
    Solaris x86, 32-bit {JProfiler install directory}/bin/solaris-x86/libjprofilerti.so
    Solaris x86, 64-bit {JProfiler install directory}/bin/solaris-x64/libjprofilerti.so
    Mac OS, 32 and 64-bit {JProfiler install directory}/bin/macos/libjprofilerti.jnilib
    HP-UX PA_RISC, 32-bit {JProfiler install directory}/bin/hpux-parisc/libjprofilerti.sl
    HP-UX PA_RISC, 64-bit {JProfiler install directory}/bin/hpux-parisc64/libjprofilerti.sl
    HP-UX IA64, 32-bit {JProfiler install directory}/bin/hpux-ia64n/libjprofilerti.so
    HP-UX IA64, 64-bit {JProfiler install directory}/bin/hpux-ia64w/libjprofilerti.so
    AIX, 32-bit {JProfiler install directory}/bin/aix-ppc/libjprofilerti.so
    AIX, 64-bit {JProfiler install directory}/bin/aix-ppc64/libjprofilerti.so
    FreeBSD x86, 32-bit {JProfiler install directory}/bin/freebsd-x86/libjprofilerti.so
    FreeBSD x86, 64-bit {JProfiler install directory}/bin/freebsd-x64/libjprofilerti.so

    Also, you might need to add other JVM-specific options found in the remote session invocation table.

  • Java <= 1.4.2 (JVMPI)
    1. Adjust your startup command
      Add the following command line parameters to your startup command:
      • A VM parameter that tells the VM to load the profiling agent:
              -Xrunjprofiler
                          
      • A VM parameter that adds JProfiler-specific classes to the boot classpath:
        • Windows
          -Xbootclasspath/a:{JProfiler install directory}\bin\agent.jar
        • all other supported platforms
          -Xbootclasspath/a:{JProfiler install directory}/bin/agent.jar
      • other JVM-specific options found in the remote session invocation table
    2. Adjust the native library path
      The native library path is an environment variable whose name depends on on the operating system and the architecture of the JVM (not the architecture of the operating system).

      Windows, 32-bit Add {JProfiler install directory}\bin\windows to the environment variable PATH.
      Windows, 64-bit Add {JProfiler install directory}\bin\windows-x64 to the environment variable PATH.
      Linux x86, 32-bit Add {JProfiler install directory}/bin/linux-x86 to the environment variable LD_LIBRARY_PATH.
      Linux x86, 64-bit Add {JProfiler install directory}/bin/linux-x64 to the environment variable LD_LIBRARY_PATH.
      Linux PPC, 32-bit Add {JProfiler install directory}/bin/linux-ppc to the environment variable LD_LIBRARY_PATH.
      Linux PPC64, 64-bit Add {JProfiler install directory}/bin/linux-ppc64 to the environment variable LD_LIBRARY_PATH.
      Solaris SPARC, 32-bit Add {JProfiler install directory}/bin/solaris-sparc to the environment variable LD_LIBRARY_PATH.
      Solaris SPARC, 64-bit Add {JProfiler install directory}/bin/solaris-sparcv9 to the environment variable LD_LIBRARY_PATH.
      Solaris x86, 32-bit Add {JProfiler install directory}/bin/solaris-x86 to the environment variable LD_LIBRARY_PATH.
      Solaris x86, 64-bit Add {JProfiler install directory}/bin/solaris-x64 to the environment variable LD_LIBRARY_PATH.
      Mac OS, 32 and 64-bit {JProfiler install directory}/bin/macos to the environment variable DYLD_LIBRARY_PATH.
      HP-UX PA_RISC, 32-bit Add {JProfiler install directory}/bin/hpux-parisc to the environment variable SHLIB_PATH.
      HP-UX PA_RISC, 64-bit Add {JProfiler install directory}/bin/hpux-parisc64 to the environment variable SHLIB_PATH.
      HP-UX IA64, 32-bit Add {JProfiler install directory}/bin/hpux-ia64n to the environment variable SHLIB_PATH.
      HP-UX IA64, 64-bit Add {JProfiler install directory}/bin/hpux-ia64w to the environment variable SHLIB_PATH.
      AIX, 32-bit Add {JProfiler install directory}/bin/aix-ppc to the environment variable LIBPATH.
      AIX, 64-bit {JProfiler install directory}/bin/aix-ppc64 to the environment variable LIBPATH.
      FreeBSD x86, 32-bit Add {JProfiler install directory}/bin/freebsd-x86 to the environment variable LD_LIBRARY_PATH.
      FreeBSD x86, 64-bit Add {JProfiler install directory}/bin/freebsd-x64 to the environment variable LD_LIBRARY_PATH.

The remote session invocation table shows the complete commands for all supported JVMs.

  Please note that the profiling interfaces JVMPI and JVMTI only run with the standard garbage collection. If you have VM parameters on your command line that change the garbage collector type such as
  • -Xincgc
  • -XX:+UseParallelGC
  • -XX:+UseConcMarkSweepGC
  • -XX:+UseParNewGC
please make sure to remove them. It might be a good idea to remove all -XX options if you have problems with profiling.
  If you start your application from an ant build file, you can use the ant task to easily profile your application.