Connecting JConsole to a Java process: the missing -D option

Once in a while I tend to use JConsole for basic profiling of a Java process.

Somehow I always forget which flag I need to set to enable remote connections to a process. And yes, I know the option is hidden somewhere on page 3 of the documentation…

You need to add the following in the VM arguments:

-Dcom.sun.management.jmxremote

After which you can just connect JConcole to the pid of the process you’re interested in.

This entry was posted in java, jconsole. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>