Subscribe to Stuck in an Infiniteloop        RSS Feed
-----

Remote Profiling with JMXMP

Icon Leave Comment
I had an issue earlier this week where I needed to remote profile a java process, but it was not using the standard(?) RMI protocol. Some intense googling later, here are the obscure, but simple steps to get this working.

RMI requires two ports to communicate, whereas JMXMP only uses one. You'll need to port forward/tunnel that remote port to a local port. Then start visualvm or jconsole and make sure to add the jmxremote_optional.jar to your classpath.

ssh -L LOCAL_PORT:localhost:REMOTE_PORT REMOTE_HOST



visualvm -cp:a /path/to/jmeremote_optional.jar service:jmx:jmxmp://127.0.0.1:LOCAL_PORT



or

jconsole -J-Djava.class.path=/path/to/jmxremote_optional.jar:$JAVA_HOME/lib/jconsole.jar service:jmx:jmxmp://127.0.0.1:LOCAL_PORT

0 Comments On This Entry

 

September 2020

S M T W T F S
  12345
6789101112
13141516171819
2021222324 25 26
27282930   

Tags

    Recent Entries

    Recent Comments

    Search My Blog

    1 user(s) viewing

    1 Guests
    0 member(s)
    0 anonymous member(s)