# Java heap space once in a while

**URL:** <https://discuss.elastic.co/t/java-heap-space-once-in-a-while/2551>\
**Category:** Elasticsearch\
**Created:** [June 12, 2015, 9:10am UTC](https://discuss.elastic.co/t/java-heap-space-once-in-a-while/2551 "2015-06-12T09:10:55Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![eperry](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eperry/32/551_2.png) [@eperry](https://discuss.elastic.co/u/eperry)\
**Post date:** [June 13, 2015, 1:09pm UTC](https://discuss.elastic.co/t/java-heap-space-once-in-a-while/2551/3 "2015-06-13T13:09:17Z")

</div>

To ask the simple question, Even though your system has 16GB of ram this does not matter to a JVM. Elasticsearch by default runs the JVM at 1GB.

[https://www.elastic.co/guide/en/elasticsearch/guide/current/heap-sizing.html](https://www.elastic.co/guide/en/elasticsearch/guide/current/heap-sizing.html)  
export ES\_HEAP\_SIZE=10g

Also, you may want to look at the type of searches your doing and the Number of them. If you are hitting OOM like Warkolm mentioned you might have to add more nodes.

Though you could look at improving your searches to and indexes so that they are not retrieving too much data, and having to search to many indexes.

Just some more idea's

---

_[View the full topic](https://discuss.elastic.co/t/java-heap-space-once-in-a-while/2551)._
