# Analysis logstash jvm Tuning and Profiling Logstash Performance question

**URL:** <https://discuss.elastic.co/t/analysis-logstash-jvm-tuning-and-profiling-logstash-performance-question/132013>\
**Category:** Logstash\
**Created:** [May 16, 2018, 1:56am UTC](https://discuss.elastic.co/t/analysis-logstash-jvm-tuning-and-profiling-logstash-performance-question/132013 "2018-05-16T01:56:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![zqc0512](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zqc0512/32/32141_2.png) [@zqc0512](https://discuss.elastic.co/u/zqc0512)\
**Post date:** [May 16, 2018, 1:56am UTC](https://discuss.elastic.co/t/analysis-logstash-jvm-tuning-and-profiling-logstash-performance-question/132013/1 "2018-05-16T01:56:54Z")

</div>

i test a logstash instance with the visualVM at: [https://www.elastic.co/guide/en/logstash/current/tuning-logstash.html#profiling-the-heap](https://www.elastic.co/guide/en/logstash/current/tuning-logstash.html#profiling-the-heap)  
cmd is as ./logstash -b 50000 -u 1 -w 16 -f xxx.conf

why the JVM use not like a straight line see the png file . how i can change this?

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/f/a/faabd18108830466ec696330385edda88fe58bbf.png)

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/9/6903f8606b2b7c63ae2b8779b9d88298db5177d1.png)

JVM setting is

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/0/f/0f24ccc079ce632eb2969579cfca86d202c80e7e.png)

thanks..

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [May 16, 2018, 1:41pm UTC](https://discuss.elastic.co/t/analysis-logstash-jvm-tuning-and-profiling-logstash-performance-question/132013/2 "2018-05-16T13:41:58Z")

</div>

That looks like completely normal heap usage to me. When objects are allocated they are added to the heap. When heap utilization reaches 75% (CMSInitiatingOccupancyFraction) a CMS cycle will be kicked off which will garbage collect all the dead objects, thus reducing the heap utilization. Rinse and repeat.

---

<div class="post-metadata">

**Author:** ![zqc0512](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zqc0512/32/32141_2.png) [@zqc0512](https://discuss.elastic.co/u/zqc0512)\
**Post date:** [May 17, 2018, 3:45am UTC](https://discuss.elastic.co/t/analysis-logstash-jvm-tuning-and-profiling-logstash-performance-question/132013/3 "2018-05-17T03:45:41Z")

</div>

as this  
[https://www.elastic.co/guide/en/logstash/5.6/tuning-logstash.html#profiling-the-heap](https://www.elastic.co/guide/en/logstash/5.6/tuning-logstash.html#profiling-the-heap) the green as change  
i see the jvm is like a straight line .  
why?

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [May 17, 2018, 12:07pm UTC](https://discuss.elastic.co/t/analysis-logstash-jvm-tuning-and-profiling-logstash-performance-question/132013/4 "2018-05-17T12:07:41Z")

</div>

The heap usage in a JVM with a generational collector (either ParNew+CMS in HotSpot, or gencon in J9) has three sawtooth patterns at different frequencies. I do not have a chart that shows the middle frequency one, but this shows the low frequency (tenured) and high frequency (eden) patterns.

![AA1](https://us1.discourse-cdn.com/elastic/original/3X/2/8/284275f14108dc1c9b2067bc6e84421b3e0bdb3a.png)

However, if we reduce the resolution (equivalent to zooming out) the high frequency pattern disappears. This is what we see in your image.

 ![AA2](https://us1.discourse-cdn.com/elastic/original/3X/f/2/f2334048e8f6c3af8b0f9048a37f5f516f2df743.png)

And if we further reduce the resolution the low frequency pattern also disappears and we are left with random noise, which is what we have in the document you linked to.

 ![AA3](https://us1.discourse-cdn.com/elastic/original/3X/7/4/74d337686b84ef1fdd3b13fd92ead549aa27a7bc.png)

---

<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:** [June 14, 2018, 12:07pm UTC](https://discuss.elastic.co/t/analysis-logstash-jvm-tuning-and-profiling-logstash-performance-question/132013/5 "2018-06-14T12:07:42Z")

</div>

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