-2

It seems that Elasticsearch stops working this morning. When i launch : sudo service elasticsearch start, it says : Starting ElasticSearch Server Done

But when i check the status, it gives me : elasticsearch is not running

I tried to launch it by the command : /usr/share/elasticsearch/bin/elasticsearch start it gives me :

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

I tried to set 512m for Heap size in : /usr/share/elasticsearch/bin/service/elasticsearch.conf

set.default.ES_HOME= set.default.ES_HEAP_SIZE=512

enter image description here

But it didn't work. How could i fix that?

OWZY
  • 107
  • 1
  • 5

1 Answers1

2

How do you expect that java will be able to allocate 512MB heap when there's only 512MB of RAM in your entire system. The kernel needs its own RAM, as do several other processes that are running on your system (sshd, syslog, cron, etc.).

If you truly do need a 512MB heap, then you'll need to upgrade to a larger VPS. Otherwise, try setting a 256MB heap size and see if that works for you.

EEAA
  • 108,414
  • 18
  • 172
  • 242
  • I tried low sizes : 256 and 128, but in vain. What you said is logical, I know it's impossible to allocate 512m while my vps contains only 512m, but some guys told me to try it... So, i would like to know what's the right Ram to use in that case. What if i use 1go and I fall into the same error in the future ? How to calculate it ? – OWZY Feb 24 '14 at 14:08
  • You calculate it by trying something with your load pattern, collecting metrics, and identifying what works and what doesn't. There's no magic formula. – EEAA Feb 24 '14 at 14:50
  • I upgraded the Ram to 1go and it works now. – OWZY Feb 28 '14 at 17:02