How to Run Jprofiler from Windows Machine to Remote Linux Jvm

Jprofiler unable to see Jboss JVM on remote machine

You have to find the JProfiler attach helper service in the service manager and change its user account to the same user account that is used to start JProfiler. Then JProfiler should be able to show the process in jpenable if you tell it to search for services.


Update for JProfiler 10.0+:

Since JProfiler 10.0, it is possible to attach to services that are not started by the LocalSystem account. JProfiler can now attach to all services, started by admin and non-admin users.

JProfiler: why can't I attach to running JVM?

JProfiler does not use JMX to connect to a profiled JVM, it uses its own protocol. Also, you can only use the attach mode in your screen shot if the profiling agent is already loaded. You would either have to start the profiled JVM with the -agentpath=... VM parameter as given by "Session->Integration Wizards->New Remote Integration" or run the command line tool bin/jpenable on the remote machine to prepare a selected process for profiling. This will tell you the port you have to connect to.

Alternatively, you can use the "quick attach" feature in the start center to connect to any remote unrprofiled JVM through SSH. Then you do not have to prepare the JVM for profiling.

How to remotely profile a web application with JProfiler?

The easiest way to profile a remote JVM on a system without a GUI is this:

  • Extract the JProfiler archive (not the installer) somewhere on the remote machine
  • In the installation directory call bin/jpenable and select the JVM you want to profile
  • On your local machine start JProfiler and create a new session of type "Attach to profiled JVM (local or remote)"
  • In the session configuration, enter the host name and the port as given by jpenable
  • Start the session and profile

Tip: To find a bottleneck, use sampling not instrumentation.


Update for JProfiler 10.0+

Since JProfiler 10.0, there is a remote attach feature that does not require any of the above steps, you just need SSH credentials to the remote machine.

Sample Image

SSH connections are made directly by JProfiler, you don't have to set up the SSH tunnel yourself. It's also possible to configure multi-hop tunnels.

JProfiler will automatically download the required agent package, upload it to the remote machine and use its command line tools to gather the information that you see in the attach dialog. The agent package is cached, so this is only done once.

Sample Image

Because you have to authenticate as the same user that has started the JVM that you want to profile, it is possible to switch the user for the remote attach. For example, you can sudo to the root user to attach to a service that was started as root.

Sample Image

All the JVMs started by the selected user are shown and you can either start a full profiling session or just take a low-overhead HPROF heap dump and open it in JProfiler.

Sample Image

How to connect JProfiler to an application running on localhost?

Manually adding a VM parameter to a run configuration in eclipse is not recommended for profiling with JProfiler.

For more on the eclipse IDE integration, see this screen cast and this help page. You can then profile JBoss with an eclipse run configuration without adding any VM parameters.

There are other ways to profile without manually adding any VM parameters:

  1. The easiest way to get started is to use the "Quick attach" feature in JProfiler. With "Session->Quick Attach" you get a list of running JVMs that you can profile without having to add any JVM parameters.

  2. If you miss source code navigation to eclipse in the above step, the same action is available in eclipse if the JProfiler plugin is installed.

Sample Image


  1. For standalone configuration, use the integration wizard by invoking "Session->Integration Wizards->New Server Integration" from JProfiler's main menu. The integration wizard will modify the start script, so that you don't have to add any VM parameters.

For the error message that you got, I suspect that C:\Users\user\.jprofiler6\config.xml does not exist. Reducing the parameter to -agentpath:C:\Users\user~1.DOS\SOFTWA~1\JPROFI~1\bin\WINDOW~1\jprofilerti.dll=port=8849 will work, then the JBoss VM will wait until you connect with a session of type "Attach to JVM (local or remote)" from JProfiler. Anyway, adding VM parameters manually is only necessary in special situations.



Related Topics



Leave a reply



Submit