# What to do so Elastic Search doesn't consume so much resources?

**URL:** <https://discuss.elastic.co/t/what-to-do-so-elastic-search-doesnt-consume-so-much-resources/177149>\
**Category:** Elasticsearch\
**Created:** [April 16, 2019, 8:03pm UTC](https://discuss.elastic.co/t/what-to-do-so-elastic-search-doesnt-consume-so-much-resources/177149 "2019-04-16T20:03:42Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jorge\_Hernandez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jorge_hernandez/32/44283_2.png) [@Jorge\_Hernandez](https://discuss.elastic.co/u/Jorge_Hernandez)\
**Post date:** [April 16, 2019, 8:03pm UTC](https://discuss.elastic.co/t/what-to-do-so-elastic-search-doesnt-consume-so-much-resources/177149/1 "2019-04-16T20:03:42Z")

</div>

I just wished Elastic Search did not use Java, we have a server running Elastic Search Agent using 75G+ of Virtual Memory and I would like it not to use that much, I know Java is a very hungry Programming Language, but 75G+ of Virtual Memory? --wow--.

I wouldn't complain if this server was the one running the Elastic Search, but this is just the Agent of it.

I hope Elastic does something about this (hopefully stop using Java) because this is not good.

---

<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:** [April 16, 2019, 8:24pm UTC](https://discuss.elastic.co/t/what-to-do-so-elastic-search-doesnt-consume-so-much-resources/177149/2 "2019-04-16T20:24:40Z")

</div>

The OS handles that, not Elasticsearch. You will need to look into however your OS can manage/limit that.

---

<div class="post-metadata">

**Author:** ![Jorge\_Hernandez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jorge_hernandez/32/44283_2.png) [@Jorge\_Hernandez](https://discuss.elastic.co/u/Jorge_Hernandez)\
**Post date:** [April 16, 2019, 9:31pm UTC](https://discuss.elastic.co/t/what-to-do-so-elastic-search-doesnt-consume-so-much-resources/177149/3 "2019-04-16T21:31:57Z")

</div>

Not really, this is part of the Java command that opens the Agent, I believe it is the -xms and -Xms arguments that set this up, not the OS.

---

<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:** [April 16, 2019, 9:35pm UTC](https://discuss.elastic.co/t/what-to-do-so-elastic-search-doesnt-consume-so-much-resources/177149/4 "2019-04-16T21:35:40Z")

</div>

What's your heap size set to?

---

<div class="post-metadata">

**Author:** ![Jorge\_Hernandez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jorge_hernandez/32/44283_2.png) [@Jorge\_Hernandez](https://discuss.elastic.co/u/Jorge_Hernandez)\
**Post date:** [April 16, 2019, 9:52pm UTC](https://discuss.elastic.co/t/what-to-do-so-elastic-search-doesnt-consume-so-much-resources/177149/5 "2019-04-16T21:52:59Z")

</div>

```
uintx ErgoHeapSizeLimit = 0 {product}
uintx HeapSizePerGCThread = 87241520 {product}
uintx InitialHeapSize := 2147483648 {product}
uintx LargePageHeapSizeThreshold = 134217728 {product}
uintx MaxHeapSize := 32210157568 {product}
```

---

<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:** [April 16, 2019, 10:53pm UTC](https://discuss.elastic.co/t/what-to-do-so-elastic-search-doesnt-consume-so-much-resources/177149/6 "2019-04-16T22:53:17Z")

</div>

Ok, that looks like it's 32GB? It's just not a format I've seen for configuring Elasticsearch.

However Elasticsearch cannot use memory outside the JVM heap, that's the whole point of defining the limits of it. Anything that is associated with the process that is off heap is managed by the OS.

There's a few good threads in here about this topic, so it might be worth checking some of them out 🙂

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [April 17, 2019, 5:22am UTC](https://discuss.elastic.co/t/what-to-do-so-elastic-search-doesnt-consume-so-much-resources/177149/7 "2019-04-17T05:22:46Z")

</div>

Elasticsearch uses some off-heap memory in addition to what has been configured for the heap. It however also relies on the operating system file cache to ensure fast access to commonly used files. This is why it is generally recommended to give 50% of the amount of memory available to Elasticsearch to the heap.

As far as the operating system is concerned memory is there to be used, so the page cache can fill up all the remaining memory. You should however not be concerned about this as it would be released if there was some process that needed it.

---

<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:** [May 15, 2019, 5:22am UTC](https://discuss.elastic.co/t/what-to-do-so-elastic-search-doesnt-consume-so-much-resources/177149/8 "2019-05-15T05:22:47Z")

</div>

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