What to do so Elastic Search doesn't consume so much resources?

I just wished Elastic Search did not use Java, we have a server running Elastic Search Agent using 75G+ of Virtual Memory and I would like it not to use that much, I know Java is a very hungry Programming Language, but 75G+ of Virtual Memory? --wow--.

I wouldn't complain if this server was the one running the Elastic Search, but this is just the Agent of it.

I hope Elastic does something about this (hopefully stop using Java) because this is not good.

The OS handles that, not Elasticsearch. You will need to look into however your OS can manage/limit that.

Not really, this is part of the Java command that opens the Agent, I believe it is the -xms and -Xms arguments that set this up, not the OS.

What's your heap size set to?

uintx ErgoHeapSizeLimit                         = 0                                   {product}
uintx HeapSizePerGCThread                       = 87241520                            {product}
uintx InitialHeapSize                          := 2147483648                          {product}
uintx LargePageHeapSizeThreshold                = 134217728                           {product}
uintx MaxHeapSize                              := 32210157568                         {product}

Ok, that looks like it's 32GB? It's just not a format I've seen for configuring Elasticsearch.

However Elasticsearch cannot use memory outside the JVM heap, that's the whole point of defining the limits of it. Anything that is associated with the process that is off heap is managed by the OS.

There's a few good threads in here about this topic, so it might be worth checking some of them out :slight_smile:

Elasticsearch uses some off-heap memory in addition to what has been configured for the heap. It however also relies on the operating system file cache to ensure fast access to commonly used files. This is why it is generally recommended to give 50% of the amount of memory available to Elasticsearch to the heap.

As far as the operating system is concerned memory is there to be used, so the page cache can fill up all the remaining memory. You should however not be concerned about this as it would be released if there was some process that needed it.

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