0

I downloaded elasticsearch-5.2.2. Im on Windows 8.

I open terminal and go to the bin-folder. When Im there I run:

./elasticsearch

I then got this message:

Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap

According to resources I found, I need to make changes inside

elasticsearch.in.bat

I found for example this:

https://discuss.elastic.co/t/error-occurred-during-initialization-of-vm-

could-not-reserve-enough-space-for-1048576kb-object-heap-elasticsearch/33999

However, I could not find the line to change in that file.

So I go to config/jvm.options. hee I can change this lines:

-Xms2g
-Xmx2g

No matter what I write there (for example -Xms1g and -Xmx1g) this will make the terminal print this error when I try to run the application:

Error: cannot find or load the main class     org.elasticsearch.bootstrap.Elasticsearch

So Im stuck. What can I do?

NB: My computer has 8 GM RAM. I don't know why 2G reserved should be an issue.

oderfla
  • 1,695
  • 4
  • 24
  • 49

2 Answers2

1

Those settings were moved in Elasticsearch 5, check the config/jvm.options file, you should find them there.

Regarding the overall issue with size, a quick google makes me think, that this is an issue with Windows in general, as the jvm wants a continuous piece of memory, which can be hard to find (see here) - but I really just googled this, so can't speak from experience. The link I mentioned seems to indicate that everything up to 1.5gb should work out, maybe try that setting or even 1gb and see if that works for you.

Community
  • 1
  • 1
Sönke Liebau
  • 1,943
  • 14
  • 23
  • I have tried your suggestions. it was stated in the question. But still no luck. – oderfla Mar 03 '17 at 15:41
  • 1
    Sorry, I missed the piece about the jvm.options file. It sounds like your changes in here are fine and work as intended, which means that now elasticsearch actually tries to start, but runs into the error you are showing. Not sure what would trigger this tbh, it sounds a bit like classpath or maybe java_home issues, but I don't know why this wouldn't work in a default windows download. – Sönke Liebau Mar 03 '17 at 15:50
1

Ok, probably my fault. I was using git bash to run elasticsearch from command line. I switched and used ordinary cmd and then it works.

oderfla
  • 1,695
  • 4
  • 24
  • 49