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

 

December 2019

S M T W T F S
1234567
891011121314
15 16 1718192021
22232425262728
293031    

Tags

    Recent Entries

    Recent Comments

    Search My Blog

    0 user(s) viewing

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