Skip to content

Instantly share code, notes, and snippets.

@asif31iqbal
Last active November 8, 2016 22:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asif31iqbal/118e938b12166832fb9c3fcc935cf43b to your computer and use it in GitHub Desktop.
Save asif31iqbal/118e938b12166832fb9c3fcc935cf43b to your computer and use it in GitHub Desktop.
JMX remote with jconsole via ssh tunneling with socks proxy:
1. Add this to JAVA_OPTS in remote process:
-Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port={remoteJMXport} -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false
2. ssh -D {proxyport} user@remotehost
3. jconsole -J-DsocksProxyHost=localhost -J-DsocksProxyPort={proxyport} service:jmx:rmi:///jndi/rmi://{remotehost}:{remoteJMXport}/jmxrmi
For visualvm, see this link:
https://theholyjava.wordpress.com/2012/09/21/visualvm-monitoring-remote-jvm-over-ssh-jmx-or-not/
For MAT:
http://www.ryanchapin.com/fv-b-4-801/Using-the-Eclipse-Memory-Analyzer--MAT--Remotely-on-Large-Heap-Dumps.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment