Invalid initial heap size

Here you can see the values after a clean system reboot:

              total        used        free      shared  buff/cache   available
Mem:            11G        170M         11G        8.8M        143M         11G
Swap:          8.0G          0B        8.0G

Great, is it possible to see where the heap maxes out? Like increasing it from 3.5G by adding 500MB until it crashes? I am interested to see what is the maximum heap size allowed.

I attempt to increase the heap to 3.5GB but it crashes there with the message:

Sep 13 14:31:35 elk systemd[1]: Started Elasticsearch.
Sep 13 14:31:35 elk systemd[1]: Starting Elasticsearch...
Sep 13 14:31:37 elk elasticsearch[2389]: Invalid initial heap size: -Xms3.5g
Sep 13 14:31:37 elk systemd[1]: elasticsearch.service: main process exited, code=exited, 
status=1/FAILURE
Sep 13 14:31:37 elk systemd[1]: Unit elasticsearch.service entered failed state.
Sep 13 14:31:37 elk systemd[1]: elasticsearch.service failed.

OK this is probably either the system takes some cache and won't allow the JVM to take the heap or the host which your VM is on it won't give you exactly 11GB.

Do you manage the Hypervisor? Can you look at the VM configs?

Oh wait! this didn't say the maximum amount being exceeded. Can you please try the 4G? I want to make sure the (.) is not the problem here.

Here the output of the console:

Sep 13 15:15:08 elk systemd[1]: Started Elasticsearch.
Sep 13 15:15:08 elk systemd[1]: Starting Elasticsearch...
Sep 13 15:15:11 elk elasticsearch[1617]: Invalid initial heap size: -Xms4g
Sep 13 15:15:11 elk elasticsearch[1617]: The specified size exceeds the maximum representable size.
Sep 13 15:15:11 elk elasticsearch[1617]: Error: Could not create the Java Virtual Machine.
Sep 13 15:15:11 elk systemd[1]: elasticsearch.service: main process exited, code=exited, 
status=1/FAILURE
Sep 13 15:15:11 elk systemd[1]: Unit elasticsearch.service entered failed state.
Sep 13 15:15:11 elk systemd[1]: elasticsearch.service failed.

With what the system takes from memory I thought 4G should be OK. Then the only thing I can say is either system reserve some memory apart from what it uses which makes it around 4GB and it gives you less than 3.5G or the host is not really giving you 11G.

So you think either the VM is not correctly configured (the system host has not that much RAM) or the linux system is taking the RAM so I can not add RAM to the elasticsearch JVM.

That is the only conclusion I can come up with. Unfortunately, when the memory is that low it is hard to separate kernel memory/cache from free memory.

Is it possible that elasticsearch can not handle a server which has an odd number of RAM?

I really don't think this has anything to do with Elasticsearch. This is all JVM trying to access and reserve the amount of memory you assign and for some reasons it can't get a hold over that amount.

What is in the Elasticsearch logs? As you seem to have swap configured, is it possible you are hitting one of the bootstrap checks?

Problem solved!

Solution: the wrong java version was installed. On the system was the 32bit version installed which can not handle 4GB RAM.

So thanks for all reply´s!
Best regards,
Robert!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.