Something else is taking memory I suspect... Perhaps Kibana
If you use the default Elasticsearch will claim 50% of the available RAM ... If it is not available it will crash.
To configure the heap size, add the Xms and Xmx JVM arguments to a custom JVM options file with the extension .options and store it in the jvm.options.d/ directory. For example, to set the maximum heap size to 2GB, set both Xms and Xmx to 2g:
In your case I would try 1GB
-Xms1g
-Xmx1g
Or get a bit larger machine, elasticsearch is greedy for RAM and does not really like other processes running unless you set the heap size