# Should GC occur if there's available mem in the heap?

**URL:** <https://discuss.elastic.co/t/should-gc-occur-if-theres-available-mem-in-the-heap/4574>\
**Category:** Elasticsearch\
**Created:** [June 8, 2011, 2:21pm UTC](https://discuss.elastic.co/t/should-gc-occur-if-theres-available-mem-in-the-heap/4574 "2011-06-08T14:21:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Enrique\_Medina\_Monte](https://avatars.discourse-cdn.com/v4/letter/e/4491bb/32.png) [@Enrique\_Medina\_Monte](https://discuss.elastic.co/u/Enrique_Medina_Monte)\
**Post date:** [June 8, 2011, 2:21pm UTC](https://discuss.elastic.co/t/should-gc-occur-if-theres-available-mem-in-the-heap/4574/1 "2011-06-08T14:21:05Z")

</div>

Hi,

After solving all the issues I faced last week, I've been monitoring my ES  
server with the new tool developed Lucas Vlcek and I have found some  
behaviour I'd like to share with you.

I start up the ES server with "mlockall" set to true and ES\_MIN\_MEM =  
ES\_MAX\_MEM = 1.5Gb

Based on the charts displayed in this tool, for the "Mem Heap", the  
allocated says 1.5Gb, but the used never ever goes beyond 980Mb, as can be  
seen in this screenshot:

[image: Screen shot 2011-06-08 at 4.18.11 PM.png]

This has been the case for every day since I last started up the ES server,  
almost one week ago. However, and this is what I find hard to understand,  
the GC statistics show activity:

[image: Screen shot 2011-06-08 at 4.19.50 PM.png]

Why is the GC having activity when there's plenty of head memory available?  
I'm not complaining about this, just trying to understand the behaviour and  
strategy.

Thanks.

---

<div class="post-metadata">

**Author:** ![fashionalwallet](https://avatars.discourse-cdn.com/v4/letter/f/839c29/32.png) [@fashionalwallet](https://discuss.elastic.co/u/fashionalwallet)\
**Post date:** [June 9, 2011, 9:08am UTC](https://discuss.elastic.co/t/should-gc-occur-if-theres-available-mem-in-the-heap/4574/2 "2011-06-09T09:08:23Z")

</div>

- deleted -

---

<div class="post-metadata">

**Author:** ![Enrique\_Medina\_Monte](https://avatars.discourse-cdn.com/v4/letter/e/4491bb/32.png) [@Enrique\_Medina\_Monte](https://discuss.elastic.co/u/Enrique_Medina_Monte)\
**Post date:** [June 10, 2011, 8:49am UTC](https://discuss.elastic.co/t/should-gc-occur-if-theres-available-mem-in-the-heap/4574/3 "2011-06-10T08:49:47Z")

</div>

No feedback? ☹

On Wed, Jun 8, 2011 at 4:21 PM, Enrique Medina Montenegro \<  
[e.medina.m@gmail.com](mailto:e.medina.m@gmail.com)\> wrote:

> Hi,
> 
> After solving all the issues I faced last week, I've been monitoring my ES  
> server with the new tool developed Lucas Vlcek and I have found some  
> behaviour I'd like to share with you.
> 
> I start up the ES server with "mlockall" set to true and ES\_MIN\_MEM =  
> ES\_MAX\_MEM = 1.5Gb
> 
> Based on the charts displayed in this tool, for the "Mem Heap", the  
> allocated says 1.5Gb, but the used never ever goes beyond 980Mb, as can be  
> seen in this screenshot:
> 
> [image: Screen shot 2011-06-08 at 4.18.11 PM.png]
> 
> This has been the case for every day since I last started up the ES server,  
> almost one week ago. However, and this is what I find hard to understand,  
> the GC statistics show activity:
> 
> [image: Screen shot 2011-06-08 at 4.19.50 PM.png]
> 
> Why is the GC having activity when there's plenty of head memory available?  
> I'm not complaining about this, just trying to understand the behaviour and  
> strategy.
> 
> Thanks.

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [June 10, 2011, 9:14am UTC](https://discuss.elastic.co/t/should-gc-occur-if-theres-available-mem-in-the-heap/4574/4 "2011-06-10T09:14:59Z")

</div>

The JVM heap is broken down into several generations, there is activity in the young generation.

On Friday, June 10, 2011 at 11:49 AM, Enrique Medina Montenegro wrote:

> No feedback? ☹
> 
> On Wed, Jun 8, 2011 at 4:21 PM, Enrique Medina Montenegro \<[e.medina.m@gmail.com](mailto:e.medina.m@gmail.com) ([mailto:e.medina.m@gmail.com](mailto:e.medina.m@gmail.com))\> wrote:
> 
> > Hi,
> > 
> > After solving all the issues I faced last week, I've been monitoring my ES server with the new tool developed Lucas Vlcek and I have found some behaviour I'd like to share with you.
> > 
> > I start up the ES server with "mlockall" set to true and ES\_MIN\_MEM = ES\_MAX\_MEM = 1.5Gb
> > 
> > Based on the charts displayed in this tool, for the "Mem Heap", the allocated says 1.5Gb, but the used never ever goes beyond 980Mb, as can be seen in this screenshot:
> > 
> > This has been the case for every day since I last started up the ES server, almost one week ago. However, and this is what I find hard to understand, the GC statistics show activity:
> > 
> > Why is the GC having activity when there's plenty of head memory available? I'm not complaining about this, just trying to understand the behaviour and strategy.
> > 
> > Thanks.

---

<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, 4:03am UTC](https://discuss.elastic.co/t/should-gc-occur-if-theres-available-mem-in-the-heap/4574/5 "2017-07-06T04:03:54Z")

</div>

Closed on July 6, 2017, 4:03am UTC


