JVM Status and Memory leak

Hi Team,

For a more detailed analysis of JVMs, could anyone suggest how we can set up alerts for JVM status and detect potential memory leaks? Currently, we do not have any built-in metrics for this.

Is it possible to visualize this data on a dashboard or create alerts using JMX plugins?

Hi @Vikas_g1997

Yes, displaying this in Dynatrace is of course possible — the basic view is available under the JVM tab on the detected process. Dynatrace itself natively alerts on certain GC warnings, such as long-term GC and similar events. However, the threshold is auto-adaptive, so if you want something more static, I recommend setting up a metric event based on the metrics provided by OneAgent during measurement. You can find these metrics under “JVM” in the Metrics section.

You can take inspiration from our metric, which measures memory usage, for example — it monitors memory utilization.
((builtin:tech.jvm.memory.pool.used:filter(and(or(in(“dt.entity.process_group_instance”,entitySelector(“type(process_group_instance),tag(~”[Environment]DT_RELEASE_PRODUCT:Your tag~“),tag(~”[Environment]DT_RELEASE_STAGE:Your tag~“)”))))):splitBy():sort(value(auto,descending))/(builtin:tech.jvm.memory.pool.max:filter(and(or(in(“dt.entity.process_group_instance”,entitySelector(“type(process_group_instance),tag(~”[Environment]DT_RELEASE_PRODUCT:Your tag~“),tag(~”[Environment]DT_RELEASE_STAGE:Your tag~“)”))))):splitBy():max:sort(value(max,descending)))))*100

Alternatively, you can display the data on a similar dashboard.

Here are some example metrics for reference
builtin:tech.generic.mem.workingSetSize
builtin:tech.jvm.memory.pool.committed  poolname: metaspace
builtin:tech.jvm.memory.pool.committed  poolname: CodeHeap 'profiled nmethods