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  not equal to maximum heap size 
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?