# How much virtual memory does a 30.5Gb heap(256 Gb memory in total) for Elasticsearch support?

**URL:** <https://discuss.elastic.co/t/how-much-virtual-memory-does-a-30-5gb-heap-256-gb-memory-in-total-for-elasticsearch-support/39031>\
**Category:** Elasticsearch\
**Created:** [January 12, 2016, 8:36pm UTC](https://discuss.elastic.co/t/how-much-virtual-memory-does-a-30-5gb-heap-256-gb-memory-in-total-for-elasticsearch-support/39031 "2016-01-12T20:36:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lee891031](https://avatars.discourse-cdn.com/v4/letter/l/c89c15/32.png) [@lee891031](https://discuss.elastic.co/u/lee891031)\
**Post date:** [January 12, 2016, 8:36pm UTC](https://discuss.elastic.co/t/how-much-virtual-memory-does-a-30-5gb-heap-256-gb-memory-in-total-for-elasticsearch-support/39031/1 "2016-01-12T20:36:30Z")

</div>

Hello,

Assume I have a machine with 256gb memory and 12TB SSD. Indexed document size is 100TB. I assign 30.5 GB to Elasticsearch heap. The remaining is for Lucene and OS.

My question is, how much virtual memory does Elasticsearch support? To put it in another way, how many indexed documents can I put into the virtual memory for each machine?

Thanks,

Yifei

---

<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:** [January 12, 2016, 9:45pm UTC](https://discuss.elastic.co/t/how-much-virtual-memory-does-a-30-5gb-heap-256-gb-memory-in-total-for-elasticsearch-support/39031/2 "2016-01-12T21:45:51Z")

</div>

> [@lee891031](#):
>
> My question is, how much virtual memory does Elasticsearch support?

It doesn't support any, it only uses the heap. The OS handles the rest.

---

<div class="post-metadata">

**Author:** ![lee891031](https://avatars.discourse-cdn.com/v4/letter/l/c89c15/32.png) [@lee891031](https://discuss.elastic.co/u/lee891031)\
**Post date:** [January 12, 2016, 11:42pm UTC](https://discuss.elastic.co/t/how-much-virtual-memory-does-a-30-5gb-heap-256-gb-memory-in-total-for-elasticsearch-support/39031/4 "2016-01-12T23:42:10Z")

</div>

Thanks very much for your reply!

Then what about Lucene? I read that on a 64-bit system, it is advised to use mmapfs. And I read that Lucene will take advantage of the Virtual memory. What is the maximum of size of virtual memory does the Lucene with 196gb physical memory support?

Thanks,

Yifei

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [January 13, 2016, 12:22am UTC](https://discuss.elastic.co/t/how-much-virtual-memory-does-a-30-5gb-heap-256-gb-memory-in-total-for-elasticsearch-support/39031/5 "2016-01-13T00:22:02Z")

</div>

Virtual memory is supported by the operating system. For example, for Red Hat Enterprise Linux, you can read about the limits here:

[https://access.redhat.com/articles/rhel-limits](https://access.redhat.com/articles/rhel-limits)

ES uses the Java VM, and a Java VM runs as a process on your operating system. I recommend 64 bit so you can make use of mmapfs.

RHEL7 can support 128 TB virtual address space per process on x86\_64 architecture. Note, this is far more than any Java VM process can use in practice.

---

<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 5, 2017, 11:25pm UTC](https://discuss.elastic.co/t/how-much-virtual-memory-does-a-30-5gb-heap-256-gb-memory-in-total-for-elasticsearch-support/39031/6 "2017-07-05T23:25:04Z")

</div>


