# Elasticsearch taking a long time for garbage collection

**URL:** https://discuss.elastic.co/t/elasticsearch-taking-a-long-time-for-garbage-collection/21321
**Category:** Elasticsearch
**Created:** [December 18, 2014, 6:54pm UTC](https://discuss.elastic.co/t/elasticsearch-taking-a-long-time-for-garbage-collection/21321 "2014-12-18T18:54:29Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![shriyansh\_jain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shriyansh_jain/32/1035_2.png) [@shriyansh\_jain](https://discuss.elastic.co/u/shriyansh_jain)
#### Post date: [December 18, 2014, 6:54pm UTC](https://discuss.elastic.co/t/elasticsearch-taking-a-long-time-for-garbage-collection/21321/1 "2014-12-18T18:54:29Z")

</div>

Hi All,

I am seeing some warning message in elasticsearh log files which are taking  
pretty long time for garbage collection.

[2014-12-17 10:12:23,789][INFO][monitor.jvm] [Node1]  
[gc][young][145219][4796] duration [901ms], collections [1]/[1.5s], total  
[901ms]/[7.1m], memory [7.2gb]-\>[7.2gb]/[9.9gb], all\_pools {[young]  
[104.7mb]-\>[518.1kb]/[133.1mb]}{[survivor]  
[8.3mb]-\>[12.6mb]/[16.6mb]}{[old] [7.1gb]-\>[7.2gb]/[9.8gb]}  
[2014-12-17 10:12:29,172][WARN][monitor.jvm] [Node1]  
[gc][young][145220][4797] duration [4.1s], collections [1]/[5s], total  
[4.1s]/[7.2m], memory [7.2gb]-\>[7.4gb]/[9.9gb], all\_pools {[young]  
[518.1kb]-\>[109.4mb]/[133.1mb]}{[survivor]  
[12.6mb]-\>[16.6mb]/[16.6mb]}{[old] [7.2gb]-\>[7.3gb]/[9.8gb]}  
[2014-12-17 10:12:33,188][INFO][monitor.jvm] [Node1]  
[gc][young][145224][4798] duration [791ms], collections [1]/[1s], total  
[791ms]/[7.2m], memory [8.9gb]-\>[8.8gb]/[9.9gb], all\_pools {[young]  
[130.2mb]-\>[2kb]/[133.1mb]}{[survivor] [16.6mb]-\>[16.6mb]/[16.6mb]}{[old]  
[8.7gb]-\>[8.8gb]/[9.8gb]}  
[2014-12-17 10:13:18,476][INFO][monitor.jvm] [Node1]  
[gc][young][145268][4799] duration [710ms], collections [1]/[1.3s], total  
[710ms]/[7.2m], memory [2.9gb]-\>[2.8gb]/[9.9gb], all\_pools {[young]  
[128.6mb]-\>[3.5mb]/[133.1mb]}{[survivor] [16.6mb]-\>[11mb]/[16.6mb]}{[old]  
[2.7gb]-\>[2.8gb]/[9.8gb]}

I have cluster of two elasticsearch nodes, with 10GB and 8GB of Heap.  
Currently 60 shards in elasticsearch with around 2.5GB of data. What can be  
a probable reason for GC to take such a along time.

Thanks!  
Shriyansh

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/6a92e329-a8ad-4d8e-96ac-5a9025c647cb%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/6a92e329-a8ad-4d8e-96ac-5a9025c647cb%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [December 19, 2014, 7:50am UTC](https://discuss.elastic.co/t/elasticsearch-taking-a-long-time-for-garbage-collection/21321/2 "2014-12-19T07:50:01Z")

</div>

You should really have heap the size on both nodes.

What ES and java versions are you on?

On 18 December 2014 at 19:54, shriyansh jain [shriyanshajain@gmail.com](mailto:shriyanshajain@gmail.com)  
wrote:

> Hi All,
> 
> I am seeing some warning message in elasticsearh log files which are  
> taking pretty long time for garbage collection.
> 
> [2014-12-17 10:12:23,789][INFO][monitor.jvm] [Node1]  
> [gc][young][145219][4796] duration [901ms], collections [1]/[1.5s], total  
> [901ms]/[7.1m], memory [7.2gb]-\>[7.2gb]/[9.9gb], all\_pools {[young]  
> [104.7mb]-\>[518.1kb]/[133.1mb]}{[survivor]  
> [8.3mb]-\>[12.6mb]/[16.6mb]}{[old] [7.1gb]-\>[7.2gb]/[9.8gb]}  
> [2014-12-17 10:12:29,172][WARN][monitor.jvm] [Node1]  
> [gc][young][145220][4797] duration [4.1s], collections [1]/[5s], total  
> [4.1s]/[7.2m], memory [7.2gb]-\>[7.4gb]/[9.9gb], all\_pools {[young]  
> [518.1kb]-\>[109.4mb]/[133.1mb]}{[survivor]  
> [12.6mb]-\>[16.6mb]/[16.6mb]}{[old] [7.2gb]-\>[7.3gb]/[9.8gb]}  
> [2014-12-17 10:12:33,188][INFO][monitor.jvm] [Node1]  
> [gc][young][145224][4798] duration [791ms], collections [1]/[1s], total  
> [791ms]/[7.2m], memory [8.9gb]-\>[8.8gb]/[9.9gb], all\_pools {[young]  
> [130.2mb]-\>[2kb]/[133.1mb]}{[survivor] [16.6mb]-\>[16.6mb]/[16.6mb]}{[old]  
> [8.7gb]-\>[8.8gb]/[9.8gb]}  
> [2014-12-17 10:13:18,476][INFO][monitor.jvm] [Node1]  
> [gc][young][145268][4799] duration [710ms], collections [1]/[1.3s], total  
> [710ms]/[7.2m], memory [2.9gb]-\>[2.8gb]/[9.9gb], all\_pools {[young]  
> [128.6mb]-\>[3.5mb]/[133.1mb]}{[survivor] [16.6mb]-\>[11mb]/[16.6mb]}{[old]  
> [2.7gb]-\>[2.8gb]/[9.8gb]}
> 
> I have cluster of two elasticsearch nodes, with 10GB and 8GB of Heap.  
> Currently 60 shards in elasticsearch with around 2.5GB of data. What can be  
> a probable reason for GC to take such a along time.
> 
> Thanks!  
> Shriyansh
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/6a92e329-a8ad-4d8e-96ac-5a9025c647cb%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/6a92e329-a8ad-4d8e-96ac-5a9025c647cb%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/6a92e329-a8ad-4d8e-96ac-5a9025c647cb%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/6a92e329-a8ad-4d8e-96ac-5a9025c647cb%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAEYi1X\_0Y6WxpBxx47HA2haytc\_S%3DqjtZ9vNGN5xDgFj6RLJtg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEYi1X_0Y6WxpBxx47HA2haytc_S%3DqjtZ9vNGN5xDgFj6RLJtg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![shriyansh\_jain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shriyansh_jain/32/1035_2.png) [@shriyansh\_jain](https://discuss.elastic.co/u/shriyansh_jain)
#### Post date: [December 19, 2014, 8:16am UTC](https://discuss.elastic.co/t/elasticsearch-taking-a-long-time-for-garbage-collection/21321/3 "2014-12-19T08:16:22Z")

</div>

I have Heap Size on both the nodes.

Using openjdk 1.7.0\_09-icedtea and elasticsearch : "1.2.2".

Thanks!  
Shriyansh

On Thursday, December 18, 2014 11:50:32 PM UTC-8, Mark Walkom wrote:

> You should really have heap the size on both nodes.
> 
> What ES and java versions are you on?
> 
> On 18 December 2014 at 19:54, shriyansh jain \<[shriyan...@gmail.com](mailto:shriyan...@gmail.com)  
> \<javascript:\>\> wrote:
> 
> > Hi All,
> > 
> > I am seeing some warning message in elasticsearh log files which are  
> > taking pretty long time for garbage collection.
> > 
> > [2014-12-17 10:12:23,789][INFO][monitor.jvm] [Node1]  
> > [gc][young][145219][4796] duration [901ms], collections [1]/[1.5s], total  
> > [901ms]/[7.1m], memory [7.2gb]-\>[7.2gb]/[9.9gb], all\_pools {[young]  
> > [104.7mb]-\>[518.1kb]/[133.1mb]}{[survivor]  
> > [8.3mb]-\>[12.6mb]/[16.6mb]}{[old] [7.1gb]-\>[7.2gb]/[9.8gb]}  
> > [2014-12-17 10:12:29,172][WARN][monitor.jvm] [Node1]  
> > [gc][young][145220][4797] duration [4.1s], collections [1]/[5s], total  
> > [4.1s]/[7.2m], memory [7.2gb]-\>[7.4gb]/[9.9gb], all\_pools {[young]  
> > [518.1kb]-\>[109.4mb]/[133.1mb]}{[survivor]  
> > [12.6mb]-\>[16.6mb]/[16.6mb]}{[old] [7.2gb]-\>[7.3gb]/[9.8gb]}  
> > [2014-12-17 10:12:33,188][INFO][monitor.jvm] [Node1]  
> > [gc][young][145224][4798] duration [791ms], collections [1]/[1s], total  
> > [791ms]/[7.2m], memory [8.9gb]-\>[8.8gb]/[9.9gb], all\_pools {[young]  
> > [130.2mb]-\>[2kb]/[133.1mb]}{[survivor] [16.6mb]-\>[16.6mb]/[16.6mb]}{[old]  
> > [8.7gb]-\>[8.8gb]/[9.8gb]}  
> > [2014-12-17 10:13:18,476][INFO][monitor.jvm] [Node1]  
> > [gc][young][145268][4799] duration [710ms], collections [1]/[1.3s], total  
> > [710ms]/[7.2m], memory [2.9gb]-\>[2.8gb]/[9.9gb], all\_pools {[young]  
> > [128.6mb]-\>[3.5mb]/[133.1mb]}{[survivor] [16.6mb]-\>[11mb]/[16.6mb]}{[old]  
> > [2.7gb]-\>[2.8gb]/[9.8gb]}
> > 
> > I have cluster of two elasticsearch nodes, with 10GB and 8GB of Heap.  
> > Currently 60 shards in elasticsearch with around 2.5GB of data. What can be  
> > a probable reason for GC to take such a along time.
> > 
> > Thanks!  
> > Shriyansh
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/6a92e329-a8ad-4d8e-96ac-5a9025c647cb%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/6a92e329-a8ad-4d8e-96ac-5a9025c647cb%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/6a92e329-a8ad-4d8e-96ac-5a9025c647cb%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/6a92e329-a8ad-4d8e-96ac-5a9025c647cb%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/bf0052a6-aba0-4b7f-b84f-051b5bd7fb44%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bf0052a6-aba0-4b7f-b84f-051b5bd7fb44%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [December 19, 2014, 8:47am UTC](https://discuss.elastic.co/t/elasticsearch-taking-a-long-time-for-garbage-collection/21321/4 "2014-12-19T08:47:14Z")

</div>

Sorry, I mean you should really have the heap the _same_ size on each node.

On 19 December 2014 at 09:16, shriyansh jain [shriyanshajain@gmail.com](mailto:shriyanshajain@gmail.com)  
wrote:

> I have Heap Size on both the nodes.
> 
> Using openjdk 1.7.0\_09-icedtea and elasticsearch : "1.2.2".
> 
> Thanks!  
> Shriyansh
> 
> On Thursday, December 18, 2014 11:50:32 PM UTC-8, Mark Walkom wrote:
> 
> > You should really have heap the size on both nodes.
> > 
> > What ES and java versions are you on?
> > 
> > On 18 December 2014 at 19:54, shriyansh jain [shriyan...@gmail.com](mailto:shriyan...@gmail.com)  
> > wrote:
> > 
> > > Hi All,
> > > 
> > > I am seeing some warning message in elasticsearh log files which are  
> > > taking pretty long time for garbage collection.
> > > 
> > > [2014-12-17 10:12:23,789][INFO][monitor.jvm] [Node1]  
> > > [gc][young][145219][4796] duration [901ms], collections [1]/[1.5s], total  
> > > [901ms]/[7.1m], memory [7.2gb]-\>[7.2gb]/[9.9gb], all\_pools {[young]  
> > > [104.7mb]-\>[518.1kb]/[133.1mb]}{[survivor] [8.3mb]-\>[12.6mb]/[16.6mb]}{[old]  
> > > [7.1gb]-\>[7.2gb]/[9.8gb]}  
> > > [2014-12-17 10:12:29,172][WARN][monitor.jvm] [Node1]  
> > > [gc][young][145220][4797] duration [4.1s], collections [1]/[5s], total  
> > > [4.1s]/[7.2m], memory [7.2gb]-\>[7.4gb]/[9.9gb], all\_pools {[young]  
> > > [518.1kb]-\>[109.4mb]/[133.1mb]}{[survivor]  
> > > [12.6mb]-\>[16.6mb]/[16.6mb]}{[old] [7.2gb]-\>[7.3gb]/[9.8gb]}  
> > > [2014-12-17 10:12:33,188][INFO][monitor.jvm] [Node1]  
> > > [gc][young][145224][4798] duration [791ms], collections [1]/[1s], total  
> > > [791ms]/[7.2m], memory [8.9gb]-\>[8.8gb]/[9.9gb], all\_pools {[young]  
> > > [130.2mb]-\>[2kb]/[133.1mb]}{[survivor] [16.6mb]-\>[16.6mb]/[16.6mb]}{[old]  
> > > [8.7gb]-\>[8.8gb]/[9.8gb]}  
> > > [2014-12-17 10:13:18,476][INFO][monitor.jvm] [Node1]  
> > > [gc][young][145268][4799] duration [710ms], collections [1]/[1.3s], total  
> > > [710ms]/[7.2m], memory [2.9gb]-\>[2.8gb]/[9.9gb], all\_pools {[young]  
> > > [128.6mb]-\>[3.5mb]/[133.1mb]}{[survivor] [16.6mb]-\>[11mb]/[16.6mb]}{[old]  
> > > [2.7gb]-\>[2.8gb]/[9.8gb]}
> > > 
> > > I have cluster of two elasticsearch nodes, with 10GB and 8GB of Heap.  
> > > Currently 60 shards in elasticsearch with around 2.5GB of data. What can be  
> > > a probable reason for GC to take such a along time.
> > > 
> > > Thanks!  
> > > Shriyansh
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google  
> > > Groups "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send  
> > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > msgid/elasticsearch/6a92e329-a8ad-4d8e-96ac-5a9025c647cb%  
> > > [40googlegroups.com](http://40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/6a92e329-a8ad-4d8e-96ac-5a9025c647cb%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/6a92e329-a8ad-4d8e-96ac-5a9025c647cb%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .  
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/bf0052a6-aba0-4b7f-b84f-051b5bd7fb44%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bf0052a6-aba0-4b7f-b84f-051b5bd7fb44%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/bf0052a6-aba0-4b7f-b84f-051b5bd7fb44%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/bf0052a6-aba0-4b7f-b84f-051b5bd7fb44%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAEYi1X\_-PK4%3DN-5%3Dc2X8WnybYfkrw5qBcQ7i8%3D2j3kNbyp%2B7uA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEYi1X_-PK4%3DN-5%3Dc2X8WnybYfkrw5qBcQ7i8%3D2j3kNbyp%2B7uA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![shriyansh\_jain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shriyansh_jain/32/1035_2.png) [@shriyansh\_jain](https://discuss.elastic.co/u/shriyansh_jain)
#### Post date: [December 19, 2014, 8:53am UTC](https://discuss.elastic.co/t/elasticsearch-taking-a-long-time-for-garbage-collection/21321/5 "2014-12-19T08:53:06Z")

</div>

Okay, I have 10GB and 8GB, will make them same, will make it same. And  
another issue I am facing is the ELK stack is choking, and as soon as I  
restart elasticsearch it starts up.

Thanks!  
Shriyansh

On Friday, December 19, 2014 12:47:43 AM UTC-8, Mark Walkom wrote:

> Sorry, I mean you should really have the heap the _same_ size on each node.
> 
> On 19 December 2014 at 09:16, shriyansh jain \<[shriyan...@gmail.com](mailto:shriyan...@gmail.com)  
> \<javascript:\>\> wrote:
> 
> > I have Heap Size on both the nodes.
> > 
> > Using openjdk 1.7.0\_09-icedtea and elasticsearch : "1.2.2".
> > 
> > Thanks!  
> > Shriyansh
> > 
> > On Thursday, December 18, 2014 11:50:32 PM UTC-8, Mark Walkom wrote:
> > 
> > > You should really have heap the size on both nodes.
> > > 
> > > What ES and java versions are you on?
> > > 
> > > On 18 December 2014 at 19:54, shriyansh jain [shriyan...@gmail.com](mailto:shriyan...@gmail.com)  
> > > wrote:
> > > 
> > > > Hi All,
> > > > 
> > > > I am seeing some warning message in elasticsearh log files which are  
> > > > taking pretty long time for garbage collection.
> > > > 
> > > > [2014-12-17 10:12:23,789][INFO][monitor.jvm] [Node1]  
> > > > [gc][young][145219][4796] duration [901ms], collections [1]/[1.5s], total  
> > > > [901ms]/[7.1m], memory [7.2gb]-\>[7.2gb]/[9.9gb], all\_pools {[young]  
> > > > [104.7mb]-\>[518.1kb]/[133.1mb]}{[survivor]  
> > > > [8.3mb]-\>[12.6mb]/[16.6mb]}{[old] [7.1gb]-\>[7.2gb]/[9.8gb]}  
> > > > [2014-12-17 10:12:29,172][WARN][monitor.jvm] [Node1]  
> > > > [gc][young][145220][4797] duration [4.1s], collections [1]/[5s], total  
> > > > [4.1s]/[7.2m], memory [7.2gb]-\>[7.4gb]/[9.9gb], all\_pools {[young]  
> > > > [518.1kb]-\>[109.4mb]/[133.1mb]}{[survivor]  
> > > > [12.6mb]-\>[16.6mb]/[16.6mb]}{[old] [7.2gb]-\>[7.3gb]/[9.8gb]}  
> > > > [2014-12-17 10:12:33,188][INFO][monitor.jvm] [Node1]  
> > > > [gc][young][145224][4798] duration [791ms], collections [1]/[1s], total  
> > > > [791ms]/[7.2m], memory [8.9gb]-\>[8.8gb]/[9.9gb], all\_pools {[young]  
> > > > [130.2mb]-\>[2kb]/[133.1mb]}{[survivor] [16.6mb]-\>[16.6mb]/[16.6mb]}{[old]  
> > > > [8.7gb]-\>[8.8gb]/[9.8gb]}  
> > > > [2014-12-17 10:13:18,476][INFO][monitor.jvm] [Node1]  
> > > > [gc][young][145268][4799] duration [710ms], collections [1]/[1.3s], total  
> > > > [710ms]/[7.2m], memory [2.9gb]-\>[2.8gb]/[9.9gb], all\_pools {[young]  
> > > > [128.6mb]-\>[3.5mb]/[133.1mb]}{[survivor] [16.6mb]-\>[11mb]/[16.6mb]}{[old]  
> > > > [2.7gb]-\>[2.8gb]/[9.8gb]}
> > > > 
> > > > I have cluster of two elasticsearch nodes, with 10GB and 8GB of Heap.  
> > > > Currently 60 shards in elasticsearch with around 2.5GB of data. What can be  
> > > > a probable reason for GC to take such a along time.
> > > > 
> > > > Thanks!  
> > > > Shriyansh
> > > > 
> > > > --  
> > > > You received this message because you are subscribed to the Google  
> > > > Groups "elasticsearch" group.  
> > > > To unsubscribe from this group and stop receiving emails from it, send  
> > > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > > msgid/elasticsearch/6a92e329-a8ad-4d8e-96ac-5a9025c647cb%  
> > > > [40googlegroups.com](http://40googlegroups.com)  
> > > > [https://groups.google.com/d/msgid/elasticsearch/6a92e329-a8ad-4d8e-96ac-5a9025c647cb%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/6a92e329-a8ad-4d8e-96ac-5a9025c647cb%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > .  
> > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google Groups  
> > > "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send an  
> > > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/elasticsearch/bf0052a6-aba0-4b7f-b84f-051b5bd7fb44%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bf0052a6-aba0-4b7f-b84f-051b5bd7fb44%40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/bf0052a6-aba0-4b7f-b84f-051b5bd7fb44%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/bf0052a6-aba0-4b7f-b84f-051b5bd7fb44%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .  
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/6aa4dbcc-52b6-4703-8ab6-aa9462738849%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/6aa4dbcc-52b6-4703-8ab6-aa9462738849%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![vineeth\_mohan\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vineeth_mohan_2/32/747_2.png) [@vineeth\_mohan\_2](https://discuss.elastic.co/u/vineeth_mohan_2)
#### Post date: [December 22, 2014, 4:12am UTC](https://discuss.elastic.co/t/elasticsearch-taking-a-long-time-for-garbage-collection/21321/6 "2014-12-22T04:12:55Z")

</div>

Hello ,

Use Sun Java , it will help a lot.  
Second there has been back pressure from Elasticsearch to logstash.  
To handle that , try increasing bulk/index queue size of Elasticsearch.  
But then that wont help much as its memory intesnive or at max , it might  
give you some extra time.  
Best approach would be to place kafka queue or rabbitmq queue between  
logstash and Elasticsearch.

Or even increasing shard and adding one more machine will help.

Thanks  
Vineeth

On Fri, Dec 19, 2014 at 2:23 PM, shriyansh jain [shriyanshajain@gmail.com](mailto:shriyanshajain@gmail.com)  
wrote:

> Okay, I have 10GB and 8GB, will make them same, will make it same. And  
> another issue I am facing is the ELK stack is choking, and as soon as I  
> restart elasticsearch it starts up.
> 
> Thanks!  
> Shriyansh
> 
> On Friday, December 19, 2014 12:47:43 AM UTC-8, Mark Walkom wrote:
> 
> > Sorry, I mean you should really have the heap the _same_ size on each  
> > node.
> > 
> > On 19 December 2014 at 09:16, shriyansh jain [shriyan...@gmail.com](mailto:shriyan...@gmail.com)  
> > wrote:
> > 
> > > I have Heap Size on both the nodes.
> > > 
> > > Using openjdk 1.7.0\_09-icedtea and elasticsearch : "1.2.2".
> > > 
> > > Thanks!  
> > > Shriyansh
> > > 
> > > On Thursday, December 18, 2014 11:50:32 PM UTC-8, Mark Walkom wrote:
> > > 
> > > > You should really have heap the size on both nodes.
> > > > 
> > > > What ES and java versions are you on?
> > > > 
> > > > On 18 December 2014 at 19:54, shriyansh jain [shriyan...@gmail.com](mailto:shriyan...@gmail.com)  
> > > > wrote:
> > > > 
> > > > > Hi All,
> > > > > 
> > > > > I am seeing some warning message in elasticsearh log files which are  
> > > > > taking pretty long time for garbage collection.
> > > > > 
> > > > > [2014-12-17 10:12:23,789][INFO][monitor.jvm] [Node1]  
> > > > > [gc][young][145219][4796] duration [901ms], collections [1]/[1.5s], total  
> > > > > [901ms]/[7.1m], memory [7.2gb]-\>[7.2gb]/[9.9gb], all\_pools {[young]  
> > > > > [104.7mb]-\>[518.1kb]/[133.1mb]}{[survivor]  
> > > > > [8.3mb]-\>[12.6mb]/[16.6mb]}{[old] [7.1gb]-\>[7.2gb]/[9.8gb]}  
> > > > > [2014-12-17 10:12:29,172][WARN][monitor.jvm] [Node1]  
> > > > > [gc][young][145220][4797] duration [4.1s], collections [1]/[5s], total  
> > > > > [4.1s]/[7.2m], memory [7.2gb]-\>[7.4gb]/[9.9gb], all\_pools {[young]  
> > > > > [518.1kb]-\>[109.4mb]/[133.1mb]}{[survivor]  
> > > > > [12.6mb]-\>[16.6mb]/[16.6mb]}{[old] [7.2gb]-\>[7.3gb]/[9.8gb]}  
> > > > > [2014-12-17 10:12:33,188][INFO][monitor.jvm] [Node1]  
> > > > > [gc][young][145224][4798] duration [791ms], collections [1]/[1s], total  
> > > > > [791ms]/[7.2m], memory [8.9gb]-\>[8.8gb]/[9.9gb], all\_pools {[young]  
> > > > > [130.2mb]-\>[2kb]/[133.1mb]}{[survivor] [16.6mb]-\>[16.6mb]/[16.6mb]}{[old]  
> > > > > [8.7gb]-\>[8.8gb]/[9.8gb]}  
> > > > > [2014-12-17 10:13:18,476][INFO][monitor.jvm] [Node1]  
> > > > > [gc][young][145268][4799] duration [710ms], collections [1]/[1.3s], total  
> > > > > [710ms]/[7.2m], memory [2.9gb]-\>[2.8gb]/[9.9gb], all\_pools {[young]  
> > > > > [128.6mb]-\>[3.5mb]/[133.1mb]}{[survivor] [16.6mb]-\>[11mb]/[16.6mb]}{[  
> > > > > old] [2.7gb]-\>[2.8gb]/[9.8gb]}
> > > > > 
> > > > > I have cluster of two elasticsearch nodes, with 10GB and 8GB of Heap.  
> > > > > Currently 60 shards in elasticsearch with around 2.5GB of data. What can be  
> > > > > a probable reason for GC to take such a along time.
> > > > > 
> > > > > Thanks!  
> > > > > Shriyansh
> > > > > 
> > > > > --  
> > > > > You received this message because you are subscribed to the Google  
> > > > > Groups "elasticsearch" group.  
> > > > > To unsubscribe from this group and stop receiving emails from it, send  
> > > > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > > > msgid/elasticsearch/6a92e329-a8ad-4d8e-96ac-5a9025c647cb%40goo  
> > > > > [glegroups.com](http://glegroups.com)  
> > > > > [https://groups.google.com/d/msgid/elasticsearch/6a92e329-a8ad-4d8e-96ac-5a9025c647cb%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/6a92e329-a8ad-4d8e-96ac-5a9025c647cb%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > > .  
> > > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > > 
> > > > --  
> > > > You received this message because you are subscribed to the Google  
> > > > Groups "elasticsearch" group.  
> > > > To unsubscribe from this group and stop receiving emails from it, send  
> > > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > > msgid/elasticsearch/bf0052a6-aba0-4b7f-b84f-051b5bd7fb44%  
> > > > [40googlegroups.com](http://40googlegroups.com)  
> > > > [https://groups.google.com/d/msgid/elasticsearch/bf0052a6-aba0-4b7f-b84f-051b5bd7fb44%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/bf0052a6-aba0-4b7f-b84f-051b5bd7fb44%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > .  
> > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/6aa4dbcc-52b6-4703-8ab6-aa9462738849%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/6aa4dbcc-52b6-4703-8ab6-aa9462738849%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/6aa4dbcc-52b6-4703-8ab6-aa9462738849%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/6aa4dbcc-52b6-4703-8ab6-aa9462738849%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAGdPd5ncnaRm8VORo-ePEVSFTDopTOmp3PW0Y8MHPEZ2dLJgBg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGdPd5ncnaRm8VORo-ePEVSFTDopTOmp3PW0Y8MHPEZ2dLJgBg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:42am UTC](https://discuss.elastic.co/t/elasticsearch-taking-a-long-time-for-garbage-collection/21321/7 "2017-07-06T00:42:27Z")

</div>


