<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Monitor Java Heap Space Usage in Dynatrace in Open Q&amp;A</title>
    <link>https://community.dynatrace.com/t5/Open-Q-A/Monitor-Java-Heap-Space-Usage-in-Dynatrace/m-p/175958#M19003</link>
    <description>&lt;P&gt;&lt;EM&gt;Summary:&amp;nbsp;This post explains how to monitor Java heap space with Dynatrace, including where to view memory charts, GC data, and how to identify leaks or high allocation behaviour. It also covers what OneAgent collects automatically.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Trying to see if there is a way to alert for Java heap memory issues, specifically the message below. I originally tried doing something such as taking the first metric below and dividing it by the 2nd, then multiplying the result by 100 to get the "percentage of Java heap used". It seems this Java heap space error message is logged even when the percentage is not at 100%?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We are not using Dynatrace log analytics, so looking for that error message is not an option. When we get this heap memory error in the application logs, we want to somehow see that also in Dynatrace.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;builtin:tech.jvm.memory.pool.used&lt;/P&gt;
&lt;P&gt;builtin:tech.jvm.memory.pool.commited&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Something unexpected happened; the data (if any) is &amp;lt;null&amp;gt; and the exception (if any) is java.lang.OutOfMemoryError: Java heap space&lt;BR /&gt;at java.lang.StringBuilder.ensureCapacityImpl(StringBuilder.java:342)&lt;BR /&gt;at java.lang.StringBuilder.append(StringBuilder.java:208)&lt;/P&gt;</description>
    <pubDate>Fri, 23 Jan 2026 10:24:18 GMT</pubDate>
    <dc:creator>sivart_89</dc:creator>
    <dc:date>2026-01-23T10:24:18Z</dc:date>
    <item>
      <title>Monitor Java Heap Space Usage in Dynatrace</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/Monitor-Java-Heap-Space-Usage-in-Dynatrace/m-p/175958#M19003</link>
      <description>&lt;P&gt;&lt;EM&gt;Summary:&amp;nbsp;This post explains how to monitor Java heap space with Dynatrace, including where to view memory charts, GC data, and how to identify leaks or high allocation behaviour. It also covers what OneAgent collects automatically.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Trying to see if there is a way to alert for Java heap memory issues, specifically the message below. I originally tried doing something such as taking the first metric below and dividing it by the 2nd, then multiplying the result by 100 to get the "percentage of Java heap used". It seems this Java heap space error message is logged even when the percentage is not at 100%?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We are not using Dynatrace log analytics, so looking for that error message is not an option. When we get this heap memory error in the application logs, we want to somehow see that also in Dynatrace.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;builtin:tech.jvm.memory.pool.used&lt;/P&gt;
&lt;P&gt;builtin:tech.jvm.memory.pool.commited&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Something unexpected happened; the data (if any) is &amp;lt;null&amp;gt; and the exception (if any) is java.lang.OutOfMemoryError: Java heap space&lt;BR /&gt;at java.lang.StringBuilder.ensureCapacityImpl(StringBuilder.java:342)&lt;BR /&gt;at java.lang.StringBuilder.append(StringBuilder.java:208)&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jan 2026 10:24:18 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/Monitor-Java-Heap-Space-Usage-in-Dynatrace/m-p/175958#M19003</guid>
      <dc:creator>sivart_89</dc:creator>
      <dc:date>2026-01-23T10:24:18Z</dc:date>
    </item>
    <item>
      <title>Re: Java Heap Space Memory Monitoring</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/Monitor-Java-Heap-Space-Usage-in-Dynatrace/m-p/175960#M19004</link>
      <description>&lt;P&gt;Hi travis,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is off the top of my head, but would this work?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;((builtin:tech.jvm.memory.pool.used:filter(and(eq(poolname,"Eden Space"))))/(builtin:tech.jvm.memory.pool.committed:filter(and(eq(poolname,"Eden Space")))))*(100)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Go to settings &amp;gt; anomaly detection &amp;gt; custom events for alerting.&lt;/P&gt;&lt;P&gt;Flick to code tab and paste above into box. Hit `TAB` to validate.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then set your static threshold below.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 23:07:32 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/Monitor-Java-Heap-Space-Usage-in-Dynatrace/m-p/175960#M19004</guid>
      <dc:creator>adam_gardner</dc:creator>
      <dc:date>2021-11-16T23:07:32Z</dc:date>
    </item>
    <item>
      <title>Re: Java Heap Space Memory Monitoring</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/Monitor-Java-Heap-Space-Usage-in-Dynatrace/m-p/176046#M19021</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is better to use the max value of the pool, instead of the committed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See also the metrics expression API&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.dynatrace.com/support/help/dynatrace-api/environment-api/metric-v2/metric-expressions/" target="_blank"&gt;https://www.dynatrace.com/support/help/dynatrace-api/environment-api/metric-v2/metric-expressions/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;Harry&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2021 07:49:45 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/Monitor-Java-Heap-Space-Usage-in-Dynatrace/m-p/176046#M19021</guid>
      <dc:creator>harald_berger</dc:creator>
      <dc:date>2021-11-18T07:49:45Z</dc:date>
    </item>
    <item>
      <title>Re: Java Heap Space Memory Monitoring</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/Monitor-Java-Heap-Space-Usage-in-Dynatrace/m-p/176115#M19040</link>
      <description>&lt;P&gt;Hi Harry,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why is it better to use the max value? There is no guarantee that memory up to that value can be committed for the JVM. It's basically saying, "you will get no more than max value". It's not saying, "you will for sure get the max value". What committed is instead displaying is the guaranteed amount of memory the JVM does for sure have. So in that sense it would make that the better metric to follow.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let's say you have tons of JVMs on a server which is running out of RAM capacity. If you follow the committed value, you'd see that the usage is stuck at 100 % and you'd get an alert about it. If you follow the max value, everything appears to be working fine since the used value is still not close to max possible value. But the JVMs are already out of memory by then.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Nov 2021 11:00:02 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/Monitor-Java-Heap-Space-Usage-in-Dynatrace/m-p/176115#M19040</guid>
      <dc:creator>kalle_lahtinen</dc:creator>
      <dc:date>2021-11-19T11:00:02Z</dc:date>
    </item>
    <item>
      <title>Re: Java Heap Space Memory Monitoring</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/Monitor-Java-Heap-Space-Usage-in-Dynatrace/m-p/176120#M19041</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Depends on what you want to achieve. If you want it for alerting for committed memory, this is perfectly fine. But&amp;nbsp;be aware of the committed memory changes over time (increase / decrease). So the basis for the percentage calculation will change. This will cause jumps in you charts then. Usually committed memory starts low and the JVM increases it when a certain highwater mark is reached. This is repeated till the max memory is reached (XMX setting)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.oracle.com/javase/7/docs/api/java/lang/management/MemoryUsage.html" target="_blank"&gt;https://docs.oracle.com/javase/7/docs/api/java/lang/management/MemoryUsage.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you exactly know how much memory your application needs, you can set XMS to the same XMX value, so everything is reserved at startup.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;Harry&lt;/P&gt;</description>
      <pubDate>Fri, 19 Nov 2021 12:00:53 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/Monitor-Java-Heap-Space-Usage-in-Dynatrace/m-p/176120#M19041</guid>
      <dc:creator>harald_berger</dc:creator>
      <dc:date>2021-11-19T12:00:53Z</dc:date>
    </item>
    <item>
      <title>Re: Java Heap Space Memory Monitoring</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/Monitor-Java-Heap-Space-Usage-in-Dynatrace/m-p/176121#M19042</link>
      <description>&lt;P&gt;Yeah, that's a good point. Maybe for alerting purposes the committed memory is more important, and for charting, it's more interesting to follow how close the used memory goes in relation to the max value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By the way, the out-of-the-box graphs at Dynatrace UI show only the used and committed memory. Max values are not shown at all, you have to create your own data explorer chart to see that.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Nov 2021 12:33:15 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/Monitor-Java-Heap-Space-Usage-in-Dynatrace/m-p/176121#M19042</guid>
      <dc:creator>kalle_lahtinen</dc:creator>
      <dc:date>2021-11-19T12:33:15Z</dc:date>
    </item>
    <item>
      <title>Re: Java Heap Space Memory Monitoring</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/Monitor-Java-Heap-Space-Usage-in-Dynatrace/m-p/176122#M19043</link>
      <description>&lt;P&gt;Also for alerting be aware that is usual that used mem is the same as committed mem, till the next chunk can be reserved. So you might get alerts when actually the JVM is healthy.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Nov 2021 12:37:06 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/Monitor-Java-Heap-Space-Usage-in-Dynatrace/m-p/176122#M19043</guid>
      <dc:creator>harald_berger</dc:creator>
      <dc:date>2021-11-19T12:37:06Z</dc:date>
    </item>
    <item>
      <title>Re: Java Heap Space Memory Monitoring</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/Monitor-Java-Heap-Space-Usage-in-Dynatrace/m-p/176124#M19044</link>
      <description>&lt;P&gt;I've now had the custom event configured for a couple of days which alerts when heap space usage (used/committed mem) is over 97 % for 10 minutes. So far zero alerts, so I think it's working as intended.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Nov 2021 12:42:40 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/Monitor-Java-Heap-Space-Usage-in-Dynatrace/m-p/176124#M19044</guid>
      <dc:creator>kalle_lahtinen</dc:creator>
      <dc:date>2021-11-19T12:42:40Z</dc:date>
    </item>
    <item>
      <title>Re: Java Heap Space Memory Monitoring</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/Monitor-Java-Heap-Space-Usage-in-Dynatrace/m-p/176634#M19184</link>
      <description>&lt;P&gt;What is your custom event looking for? Wondering if its the same as what I am trying to accomplish or something different.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Nov 2021 20:07:34 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/Monitor-Java-Heap-Space-Usage-in-Dynatrace/m-p/176634#M19184</guid>
      <dc:creator>sivart_89</dc:creator>
      <dc:date>2021-11-29T20:07:34Z</dc:date>
    </item>
    <item>
      <title>Re: Java Heap Space Memory Monitoring</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/Monitor-Java-Heap-Space-Usage-in-Dynatrace/m-p/176636#M19185</link>
      <description>&lt;P&gt;Hi Travis,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's basically trying to detect if we're unable to allocate more memory for the JVM. It could be due to hitting the max value, it could be due to running out of memory resources on the host, but nonetheless it's something worth investigating so that the JVM doesn't run out of memory. That's pretty much it. Is that also your scenario?&lt;/P&gt;</description>
      <pubDate>Mon, 29 Nov 2021 20:30:43 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/Monitor-Java-Heap-Space-Usage-in-Dynatrace/m-p/176636#M19185</guid>
      <dc:creator>kalle_lahtinen</dc:creator>
      <dc:date>2021-11-29T20:30:43Z</dc:date>
    </item>
    <item>
      <title>Re: Java Heap Space Memory Monitoring</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/Monitor-Java-Heap-Space-Usage-in-Dynatrace/m-p/176638#M19186</link>
      <description>&lt;P&gt;Hello, yes I believe that would work for my situation. I'd have to get back with our application team who was having the issue. Are you able to supply the code portion of this within the custom event? Or if you used the build section, what that looks like.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Nov 2021 20:55:39 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/Monitor-Java-Heap-Space-Usage-in-Dynatrace/m-p/176638#M19186</guid>
      <dc:creator>sivart_89</dc:creator>
      <dc:date>2021-11-29T20:55:39Z</dc:date>
    </item>
    <item>
      <title>Re: Java Heap Space Memory Monitoring</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/Monitor-Java-Heap-Space-Usage-in-Dynatrace/m-p/176642#M19187</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sure, I can post it here. There are two filters used, one for including only specific Java processes tagged "WAS", and another one for the poolname "Java heap".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(builtin:tech.jvm.memory.pool.used:filter(and(in("dt.entity.process_group_instance",entitySelector("type(process_group_instance),tag(~"WAS~")")),eq(poolname,"Java heap"))))/(builtin:tech.jvm.memory.pool.committed:filter(and(in("dt.entity.process_group_instance",entitySelector("type(process_group_instance),tag(~"WAS~")")),eq(poolname,"Java heap"))))*(100)&lt;/P&gt;</description>
      <pubDate>Mon, 29 Nov 2021 21:19:07 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/Monitor-Java-Heap-Space-Usage-in-Dynatrace/m-p/176642#M19187</guid>
      <dc:creator>kalle_lahtinen</dc:creator>
      <dc:date>2021-11-29T21:19:07Z</dc:date>
    </item>
    <item>
      <title>Re: Java Heap Space Memory Monitoring</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/Monitor-Java-Heap-Space-Usage-in-Dynatrace/m-p/177048#M19223</link>
      <description>&lt;P&gt;Not sure if I understand the question correctly, but this should happen out of the box.&lt;/P&gt;&lt;P&gt;There is a built-in alert (Settings / Anomaly detection / Infrastructure) "Detect Java out-of memory problem" which should create a problem every time an out-of-memory exception is being detected by the OneAgent.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Dec 2021 15:36:36 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/Monitor-Java-Heap-Space-Usage-in-Dynatrace/m-p/177048#M19223</guid>
      <dc:creator>ben_wrightson</dc:creator>
      <dc:date>2021-12-07T15:36:36Z</dc:date>
    </item>
    <item>
      <title>Re: Java Heap Space Memory Monitoring</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/Monitor-Java-Heap-Space-Usage-in-Dynatrace/m-p/177735#M19408</link>
      <description>&lt;P&gt;OutOfMemoryError is usually too late. When you have an aleart earlier, you have a chance to gracefully stop the JVM and than restart it.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Dec 2021 10:57:40 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/Monitor-Java-Heap-Space-Usage-in-Dynatrace/m-p/177735#M19408</guid>
      <dc:creator>matthias_dillie</dc:creator>
      <dc:date>2021-12-17T10:57:40Z</dc:date>
    </item>
    <item>
      <title>Re: Java Heap Space Memory Monitoring</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/Monitor-Java-Heap-Space-Usage-in-Dynatrace/m-p/177753#M19412</link>
      <description>&lt;P&gt;See also:&lt;BR /&gt;&lt;A href="https://community.dynatrace.com/t5/Dynatrace-product-ideas/More-flexibility-defining-custom-events-for-alerts/idc-p/177751#M27128" target="_blank"&gt;https://community.dynatrace.com/t5/Dynatrace-product-ideas/More-flexibility-defining-custom-events-for-alerts/idc-p/177751#M27128&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Dec 2021 15:05:57 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/Monitor-Java-Heap-Space-Usage-in-Dynatrace/m-p/177753#M19412</guid>
      <dc:creator>matthias_dillie</dc:creator>
      <dc:date>2021-12-17T15:05:57Z</dc:date>
    </item>
  </channel>
</rss>

