# Any plans to support JVM Heap and GC stats using the Java APM agent?

**URL:** <https://discuss.elastic.co/t/any-plans-to-support-jvm-heap-and-gc-stats-using-the-java-apm-agent/160787>\
**Category:** APM\
**Created:** [December 13, 2018, 5:02pm UTC](https://discuss.elastic.co/t/any-plans-to-support-jvm-heap-and-gc-stats-using-the-java-apm-agent/160787 "2018-12-13T17:02:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeremy\_Freedman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jeremy_freedman/32/36736_2.png) [@Jeremy\_Freedman](https://discuss.elastic.co/u/Jeremy_Freedman)\
**Post date:** [December 13, 2018, 5:02pm UTC](https://discuss.elastic.co/t/any-plans-to-support-jvm-heap-and-gc-stats-using-the-java-apm-agent/160787/1 "2018-12-13T17:02:29Z")

</div>

Hi,

I was wondering if there are any plans to support monitoring the size of each generation in java's heap and the cpu time spent in gc using the Java APM agent?

I've used other APM products in the past that monitor this and have found it to be very useful.

From googling, I found a few posts that mentioned using jolokia for these stats, however, you'd have to run jolokia as it's own javaagent, and wouldn't be able to run the Java APM agent in that case.

---

<div class="post-metadata">

**Author:** ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)\
**Post date:** [December 14, 2018, 8:15am UTC](https://discuss.elastic.co/t/any-plans-to-support-jvm-heap-and-gc-stats-using-the-java-apm-agent/160787/2 "2018-12-14T08:15:35Z")

</div>

Hi and thanks for checking out Elastic APM!

We are currently working on metrics support. In fact, there is already an open PR: [https://github.com/elastic/apm-agent-java/pull/360](https://github.com/elastic/apm-agent-java/pull/360)

Are you actually interested in stats for all memory pools? In the current state of the PR, we only have metrics for heap an non-heap without dedicated metaspace stats, for example. Is that enough for you or do you need more fine-grained stats?

BTW, you can actually add multiple javaagent flags.

Cheers,  
Felix

---

<div class="post-metadata">

**Author:** ![Jeremy\_Freedman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jeremy_freedman/32/36736_2.png) [@Jeremy\_Freedman](https://discuss.elastic.co/u/Jeremy_Freedman)\
**Post date:** [December 14, 2018, 12:41pm UTC](https://discuss.elastic.co/t/any-plans-to-support-jvm-heap-and-gc-stats-using-the-java-apm-agent/160787/3 "2018-12-14T12:41:45Z")

</div>

Thanks, great to hear there is already a PR for it. The information you are capturing now is definitely helpful.

At least for me, it is also helpful to be able to look at usage of each pool, I'd be interested in the max, committed, and used space of each.

Thanks!

---

<div class="post-metadata">

**Author:** ![prv](https://avatars.discourse-cdn.com/v4/letter/p/13edae/32.png) [@prv](https://discuss.elastic.co/u/prv)\
**Post date:** [December 31, 2018, 7:36pm UTC](https://discuss.elastic.co/t/any-plans-to-support-jvm-heap-and-gc-stats-using-the-java-apm-agent/160787/4 "2018-12-31T19:36:32Z")

</div>

Looking at the PR it appears the JVM heap and GC metrics changes are now merged. Please confirm. If merged, can you point to release information (snapshot or agent build number?)

---

<div class="post-metadata">

**Author:** ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)\
**Post date:** [January 1, 2019, 9:25am UTC](https://discuss.elastic.co/t/any-plans-to-support-jvm-heap-and-gc-stats-using-the-java-apm-agent/160787/5 "2019-01-01T09:25:27Z")

</div>

Hi, it has been merged but not yet been released. You can try out the latest snapshot though: [https://github.com/elastic/apm-agent-java/blob/master/README.md#snapshots](https://github.com/elastic/apm-agent-java/blob/master/README.md#snapshots)

You will have to build your own Kibana dashboards for it currently. See the documentation for the metrics here: [https://www.elastic.co/guide/en/apm/agent/java/master/metrics.html](https://www.elastic.co/guide/en/apm/agent/java/master/metrics.html)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 22, 2019, 5:25am UTC](https://discuss.elastic.co/t/any-plans-to-support-jvm-heap-and-gc-stats-using-the-java-apm-agent/160787/6 "2019-01-22T05:25:27Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
