Remote java profiling application

I would like to ask how can I profile a REMOTELY java application. For debugging, I can tell which JVM port should listen, etc., since the machine I'm trying to access is behind the ssh gateway, so I manually create an SSH tunnel, but I searched for the same information, but with profiling and I couldn't seem to find. Basically I am looking for the equivalent of this command:

java -agentlib:jdwp=transport=dt_socket,server=y,address=8000 -jar /bla/bla 

but for profiling so that I can remotely attach the profiler.

+6
source share
1 answer

Disclaimer: my company is developing JProfiler

With JProfiler, the VM parameter is as follows:

 -agentpath:/path/to/libjprofilerti.so=port=8849 

"/path/to/libjprofilerti.so" is the path to the library of native agents, on Linux x86, for the 32-bit JVM it will be [JProfiler installation directory] /bin/linux-x86/libjprofilerti.so, with the port parameter you can tell the agent to listen on a specific port. You can install this in the port of your SSH tunnel.

You can easily generate this VM parameter by calling Session-> Integration Wizards-> New Remote Integration in the JProfiler main menu:

enter image description here

On your local machine, you create a new session of type β€œAttach to a profiled JVM” and select the local port of your SSH tunnel (10022 in the screenshot):

enter image description here

+7
source

Source: https://habr.com/ru/post/898154/


All Articles