# Heap size Not tally

**URL:** <https://discuss.elastic.co/t/heap-size-not-tally/185789>\
**Category:** Elasticsearch\
**Created:** [June 14, 2019, 8:08am UTC](https://discuss.elastic.co/t/heap-size-not-tally/185789 "2019-06-14T08:08:02Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![wangqinghuan](https://avatars.discourse-cdn.com/v4/letter/w/d26b3c/32.png) [@wangqinghuan](https://discuss.elastic.co/u/wangqinghuan)\
**Post date:** [June 14, 2019, 9:09am UTC](https://discuss.elastic.co/t/heap-size-not-tally/185789/3 "2019-06-14T09:09:08Z")

</div>

> [@skyluke.1987](#):
>
> initial heap size [2147483648] not equal to maximum heap size

> [@Initial heap size not equal to maximum heap size](https://discuss.elastic.co/t/initial-heap-size-not-equal-to-maximum-heap-size/50499):
>
> I'm trying to start elasticsearch v5 alpha 2 on an AWS EC2 instance with 8GB memory, and keep getting this error on startup: initial heap size [268435456] not equal to maximum heap size [1073741824] Then elasticsearch fails to start. I've tried setting the ES\_HEAP\_SIZE environment variable, and I've tried launching elasticsearch with -Xmx4g -Xms4g, and still get the same error. What is the correct way to set the heap size?

---

_[View the full topic](https://discuss.elastic.co/t/heap-size-not-tally/185789)._
