Problem with heap size

I have a machine running elasticsearch 7.X as a service, wich have 64GO of RAM available,

When setting the heap size of elasticsearch( Xmx and Xms 50% of my physical RAM) , it cannot accept and elasticsearch failed to start.

Another problem, when i set the heap size to x value, for example 20GO ,elasticsearch start withount problem but when i rebbot the machine or stop the service elasticsearch failed to start with the last heap size, i shoud decrease the value to start it .

How can I fix this error or what is the problem plz ?

The recommendation is generally to set the heap to 50% of RAM or around 30GB (to make sure you make use of compressed pointers). Without seeing error messages or logs it is hard to know why it is failing to start up.

Hello Christian,
when setting 30GO ,elasticsearch failed to start, bellow log message:

[2020-05-22T10:41:28.760+0000][7131][gc,heap] Heap region size: 8M
[2020-05-22T10:41:28.760+0000][7131][gc,heap,coops] Heap address: 0x0000000080000000, size: 30720 MB, Compressed Oops mode: Zero based, Oop shift amount: 3
[2020-05-22T10:41:29.082+0000][7131][gc ] Using G1
[2020-05-22T10:41:29.502+0000][7131][gc ] Periodic GC disabled
[2020-05-22T10:41:29.659+0000][7131][gc,heap,exit ] Heap
[2020-05-22T10:41:29.659+0000][7131][gc,heap,exit ] garbage-first heap total 31457280K, used 8192K [0x0000000080000000, 0x0000000800000000)
[2020-05-22T10:41:29.659+0000][7131][gc,heap,exit ] region size 8192K, 2 young (16384K), 0 survivors (0K)
[2020-05-22T10:41:29.659+0000][7131][gc,heap,exit ] Metaspace used 3134K, capacity 4480K, committed 4480K, reserved 1056768K
[2020-05-22T10:41:29.659+0000][7131][gc,heap,exit ] class space used 263K, capacity 384K, committed 384K, reserved 1048576K