# JVM Memory details using metricbeat

**URL:** <https://discuss.elastic.co/t/jvm-memory-details-using-metricbeat/159868>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [December 7, 2018, 7:31am UTC](https://discuss.elastic.co/t/jvm-memory-details-using-metricbeat/159868 "2018-12-07T07:31:27Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![460](https://avatars.discourse-cdn.com/v4/letter/4/b3f665/32.png) [@460](https://discuss.elastic.co/u/460)\
**Post date:** [December 7, 2018, 7:31am UTC](https://discuss.elastic.co/t/jvm-memory-details-using-metricbeat/159868/1 "2018-12-07T07:31:27Z")

</div>

Is it possible to get the JVM Memory details using metricbeat in 6.4.0

---

<div class="post-metadata">

**Author:** ![Kaiyan\_Sheng](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kaiyan_sheng/32/38247_2.png) [@Kaiyan\_Sheng](https://discuss.elastic.co/u/Kaiyan_Sheng)\
**Post date:** [December 7, 2018, 2:41pm UTC](https://discuss.elastic.co/t/jvm-memory-details-using-metricbeat/159868/2 "2018-12-07T14:41:44Z")

</div>

Hello @460, is this [https://www.elastic.co/guide/en/beats/metricbeat/6.4/metricbeat-metricset-jolokia-jmx.html](https://www.elastic.co/guide/en/beats/metricbeat/6.4/metricbeat-metricset-jolokia-jmx.html) what you are looking for?

---

<div class="post-metadata">

**Author:** ![460](https://avatars.discourse-cdn.com/v4/letter/4/b3f665/32.png) [@460](https://discuss.elastic.co/u/460)\
**Post date:** [December 11, 2018, 12:33pm UTC](https://discuss.elastic.co/t/jvm-memory-details-using-metricbeat/159868/3 "2018-12-11T12:33:17Z")

</div>

We have a linux servers. We need to get data related to JVM using metricbeat. How to do that?

---

<div class="post-metadata">

**Author:** ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)\
**Post date:** [December 13, 2018, 8:24am UTC](https://discuss.elastic.co/t/jvm-memory-details-using-metricbeat/159868/4 "2018-12-13T08:24:54Z")

</div>

You need to install Jolokia as mentioned in the link above and then use the Jolokia module.

---

<div class="post-metadata">

**Author:** ![460](https://avatars.discourse-cdn.com/v4/letter/4/b3f665/32.png) [@460](https://discuss.elastic.co/u/460)\
**Post date:** [December 13, 2018, 9:26am UTC](https://discuss.elastic.co/t/jvm-memory-details-using-metricbeat/159868/5 "2018-12-13T09:26:22Z")

</div>

I enabled the jolokia module in metricbeat and edited the jolokia,yml file as follows:

# Module: jolokia

# Docs: [https://www.elastic.co/guide/en/beats/metricbeat/6.4/metricbeat-module-jolokia.html](https://www.elastic.co/guide/en/beats/metricbeat/6.4/metricbeat-module-jolokia.html)

- module: jolokia  
metricsets: ["jmx"]  
enabled: true  
period: 10s  
namespace: "jolokia\_metrics"  
hosts: ["localhost:9200"]  
jmx.mappings:
  - mbean: 'java.lang:type=Runtime'  
attributes:
    - attr: Uptime  
field: uptime

  - mbean: 'java.lang:type=GarbageCollector,name=ConcurrentMarkSweep'  
attributes:
    - attr: CollectionTime  
field: gc.cms\_collection\_time
    - attr: CollectionCount  
field: gc.cms\_collection\_count

  - mbean: 'java.lang:type=Memory'  
attributes:
    - attr: HeapMemoryUsage  
field: memory.heap\_usage
    - attr: NonHeapMemoryUsage  
field: memory.non\_heap\_usage

Since elasticsearch is a java application, I started my elasticsearch. It has no password.

 ![Capture](https://us1.discourse-cdn.com/elastic/original/3X/b/6/b6405538032dbf885740b7cff26e9c3c6f9853f3.png)

But I am not able to get any.......data related to jvm stats.

Can you help me to rectify this issue

---

<div class="post-metadata">

**Author:** ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)\
**Post date:** [December 14, 2018, 9:35am UTC](https://discuss.elastic.co/t/jvm-memory-details-using-metricbeat/159868/6 "2018-12-14T09:35:45Z")

</div>

You have configure the `hosts` to `localhost:9200` which is normally the Elasticsearch endpoint. Under which address / port is your Jolokia service running?

---

<div class="post-metadata">

**Author:** ![460](https://avatars.discourse-cdn.com/v4/letter/4/b3f665/32.png) [@460](https://discuss.elastic.co/u/460)\
**Post date:** [December 14, 2018, 10:13am UTC](https://discuss.elastic.co/t/jvm-memory-details-using-metricbeat/159868/7 "2018-12-14T10:13:23Z")

</div>

Thanks for the reply. I am running the whole thing on windows. Jolokia and metricbeat will be running on the same address right? If that's the case, Its the localhost itself the jolokia is running. I don't know how to find the port number on which it would be running.

Can you please post the step-by-step process to get the JVM details along with what the hosts should be

---

<div class="post-metadata">

**Author:** ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)\
**Post date:** [December 18, 2018, 7:57am UTC](https://discuss.elastic.co/t/jvm-memory-details-using-metricbeat/159868/8 "2018-12-18T07:57:45Z")

</div>

This blog post might help you: [https://www.elastic.co/blog/monitoring-java-applications-with-metricbeat-and-jolokia](https://www.elastic.co/blog/monitoring-java-applications-with-metricbeat-and-jolokia)

---

<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 15, 2019, 7:57am UTC](https://discuss.elastic.co/t/jvm-memory-details-using-metricbeat/159868/9 "2019-01-15T07:57:50Z")

</div>

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