# Logstash jvm stats api heap used percent

**URL:** <https://discuss.elastic.co/t/logstash-jvm-stats-api-heap-used-percent/88407>\
**Category:** Logstash\
**Created:** [June 6, 2017, 11:54am UTC](https://discuss.elastic.co/t/logstash-jvm-stats-api-heap-used-percent/88407 "2017-06-06T11:54:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Exocomp](https://avatars.discourse-cdn.com/v4/letter/e/ea5d25/32.png) [@Exocomp](https://discuss.elastic.co/u/Exocomp)\
**Post date:** [June 6, 2017, 11:54am UTC](https://discuss.elastic.co/t/logstash-jvm-stats-api-heap-used-percent/88407/1 "2017-06-06T11:54:40Z")

</div>

Hi, I have question regarding the jvm info returned with the logstash node stats API (I'm on version 5.3.1).

`API => "http://127.0.0.1:9600/_node/stats/jvm"`

Here is what it returns:

```
heap_used_percent => 51 %
heap_used_in_bytes => 1.11 GB

```

My configuration is using logstash defaults with a max heap of 1GB, see below, so my question is why is heap used returning only 51% when it has already used up 1GB ?

Main PID: 29816 (java)  
└─29816 /usr/bin/java -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+DisableExplicitGC -Djava.awt.headless=true -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError **-Xmx1g** -Xms256m -Xss2048k -Djffi.boot.library.path=/usr/share/logstash/vendor/jruby/lib/jni -Xbootclasspath/a:/usr/share/logstash/vendor/jruby/lib/jruby.jar -classpath : -Djruby.home=/usr/share/logstash/vendor/jruby -Djruby.lib=/usr/share/logstash/vendor/jruby/lib -Djruby.script=jruby -Djruby.shell=/bin/sh org.jruby.Main /usr/share/logstash/lib/bootstrap/environment.rb **logstash** /runner.rb --path.settings /etc/logstash

Also the heap\_max\_in\_bytes returns different values based on the API call:

`"nodeInfo API" => "http://127.0.0.1:9600/_node/jvm"`

**heap\_max\_in\_bytes =\> 1.056 GB**

`nodeStats API => "http://127.0.0.1:9600/_node/stats/jvm"`

**heap\_max\_in\_bytes =\> 2.113 GB**

Could someone that has greater than version 5.3.1 try and see what they get for the above API calls. I take it this is a bug ?

Thanks,  
E

---

<div class="post-metadata">

**Author:** ![Exocomp](https://avatars.discourse-cdn.com/v4/letter/e/ea5d25/32.png) [@Exocomp](https://discuss.elastic.co/u/Exocomp)\
**Post date:** [June 8, 2017, 10:24am UTC](https://discuss.elastic.co/t/logstash-jvm-stats-api-heap-used-percent/88407/2 "2017-06-08T10:24:26Z")

</div>

I logged a bug on this issue here:

> <https://github.com/elastic/logstash/issues/7381>

---

<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:** [July 6, 2017, 10:24am UTC](https://discuss.elastic.co/t/logstash-jvm-stats-api-heap-used-percent/88407/3 "2017-07-06T10:24:34Z")

</div>

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