> For the complete documentation index, see [llms.txt](https://docs.fractalworks.io/joule/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fractalworks.io/joule/components/observability/enabling-jmx-for-joule.md).

# Enabling JMX for Joule

## Overview

This article explains how to enable JMX for monitoring the Joule process.

Various monitoring tools compatible with JMX are recommended at the end of the article for enhancing the user experience.

## Enabling JMX

**JMX is off by default** due to runtime overhead, but can be activated by **applying specific configurations** to the Joule process execution path.

The following snippet shows this configuration and will enable tools to directly connect to the Joule process:

```bash
-Dcom.sun.management.jmxremote.port=5000
-Dcom.sun.management.jmxremote.rmi.port=5000
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5001
```

As a baseline example, the use case projects provide a Joule start script which contain JMX setting to enable process monitoring.

This can be found with the `bin/startJoule.sh` file.

```bash
JMX_CONFIG="-Dcom.sun.management.jmxremote.port=${JOULE_JMX_PORT} -Dcom.sun.management.jmxremote.rmi.port=${JOULE_JMX_PORT} -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=${JOULE_HOST_NAME} -Dcom.sun.management.jmxremote.local.only=false"
JVM_DEBUG="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:${JOULE_JMX_DEBUG_PORT}"

nohup java ${JVM_SWITCHES} ${JMX_CONFIG} ${JVM_DEBUG} -Dlog4j.configuration=file://${LOG4J_PATH} ${JOULE_MEMORY} -XX:+UseG1GC -Dpolyglot.engine.WarnInterpreterOnly=false -cp ${CLASSPATH}  com.fractalworks.streams.joule.JouleCLI -c ${JOULE_CONFIG_PATH} -s ${SOURCEFILE} -r ${REFERENCEDATA}  -u ${ENGINEFILE} -p ${PUBLISHFILE} &
```

{% hint style="info" %}
Learn about how to use the [monitoring and management using JMX technology](https://docs.oracle.com/javase/8/docs/technotes/guides/management/agent.html)
{% endhint %}

## Tool recommendation

Any monitor tools that supports JMX can be used. We recommend some of these tools:

* [JConsole](https://docs.oracle.com/javase/8/docs/technotes/guides/management/jconsole.html)
* [JDK Mission Control](https://docs.oracle.com/en/java/java-components/jdk-mission-control/index.html)
* [VisualVM](https://visualvm.github.io/)
* [dynatrace](https://www.dynatrace.com/)

{% hint style="info" %}
Further tools can be researched through [BetterStack](https://betterstack.com/community/comparisons/?q=observability)
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.fractalworks.io/joule/components/observability/enabling-jmx-for-joule.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
